Overview of Structura.js
masterStructura.js is a high-performance, lightweight TypeScript library designed for creating immutable states using a mutable syntax. It leverages the concept of structural sharing to ensure efficiency.
Key features and advantages include:
- High Performance: Up to ~10x faster than Immer.js and often faster than Immutable.js.
- Compile-time Immutability: Unlike libraries that use
Object.freezeat runtime (which can be slow for nested objects), Structura.js leverages TypeScript to freeze objects at compile time. - Advanced Reference Support: Supports circular and multiple references.
- Flexible Producer API: Can return and modify the draft simultaneously, and offers flexibility in the return type of the producer.
- Complex Operations: Supports transpositions and moves of portions of the draft.
- Zero-toggle configuration: Most features are enabled by default.