github.com/lxsmnsyc/scoped-model ↗
Contextual state management for React, ReasonReact and Preact
Open this visualization on its own page →
Contributors
3
Lines of Code
3,255
From
2019-11-04
To
2020-12-23
About lxsmnsyc/scoped-model
Scoped-model is a contextual state management library for React, Preact, and ReasonReact. It provides a lightweight alternative to global state management solutions by enabling localized, scoped state that can be accessed by components within a defined context. The library uses React hooks and context APIs to manage state, making it straightforward to integrate into modern component-based applications.
The project is organized as a monorepo with separate packages tailored to different frameworks. The main offerings include react-scoped-model for React applications, preact-scoped-model for Preact, and re-scoped-model for ReasonReact. An additional package, react-scoped-model-swr, extends the core functionality with integration for data fetching patterns. Each package includes example implementations to help developers get started quickly.
The library is designed for developers seeking a simpler, more granular approach to state management compared to Redux or MobX, particularly useful in applications where certain state only needs to be available to a specific component subtree rather than globally. The project is written in TypeScript and distributed under the MIT license.