A universal state model library that provides a class-first approach compatible with Redux, MobX, Vuex, Pinia, and Angular.
USM is a universal state modular library that provides a generic, class-first state model for object-oriented state management. It enables developers to write state management code that works seamlessly across multiple popular state libraries like Redux, MobX, Vuex, Pinia, and Angular, reducing the need to learn each library's specific paradigms. The library abstracts away differences between these ecosystems, promoting flexible and maintainable architecture.
Developers working on projects that may use or switch between different state management libraries (e.g., Redux, MobX, Vuex, Pinia, or Angular) and prefer an object-oriented programming approach. It is also suitable for teams seeking a unified state management solution to avoid vendor lock-in and simplify code maintenance across diverse frameworks.
Developers choose USM because it offers universal compatibility, allowing the same state management code to run across Redux, MobX, Vuex, Pinia, and Angular without rewriting. Its class-first design with decorators like @state, @action, and @computed provides a straightforward OOP approach, reducing boilerplate and learning curve compared to library-specific paradigms.
🏖 A concise & flexible state model for Redux/MobX/Vuex/Pinia, etc.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works seamlessly with Redux, MobX, Vuex, Pinia, and Angular, as shown in the support table, allowing code reuse across different ecosystems without rewrites.
Uses decorators like @state and @action to provide a clean, object-oriented approach, reducing boilerplate compared to library-specific paradigms.
The createStore() function supports plugins, middleware, and strict mode, enabling customization for various state libraries as outlined in the APIs.
Includes subscribe() and watch() functions for observing state changes and specific value updates, enhancing reactivity without external tools.
Requires installing separate adapter packages (e.g., usm-redux, usm-mobx) for each state library, adding complexity to initial integration and maintenance.
Not all features are available across adapters; for instance, Mutative integration is only supported with usm and usm-redux, not MobX or Vuex, limiting universality.
For computed properties with usm or usm-redux, developers must manually specify dependencies using @computed(depsCallback), increasing cognitive load and error risk.