Unistore screenshot

Unistore

Author Avatar Theme by Developit
Updated: 17 Jun 2020
2852 Stars

350b / 650b state container with component actions for Preact & React

Categories

Overview

Unistore is a lightweight yet powerful state management solution designed for applications utilizing Preact and React frameworks. With a compact size of just 350 bytes, it integrates seamlessly without adding a significant weight to your build, making it an attractive choice for developers focused on performance. This library borrows familiar concepts from Redux, enabling developers to quickly adapt and utilize its capabilities while also introducing some of its own innovative features.

Unistore stands out with its ability to manage state efficiently through minimalistic design and functional actions that are highly portable. Additionally, it supports the novel capability to operate in a web worker, providing enhanced performance for complex applications.

Features

  • Small Footprint: At around 350 bytes, Unistore is extremely lightweight, making it perfect for applications where size matters.
  • Redux-like API: Familiar concepts from Redux help developers transition smoothly without a steep learning curve.
  • Portable Actions: Actions can be defined in a central location and imported, simplifying code organization and reusability.
  • Efficient State Updates: Provides functionality to apply partial updates to the current state easily, allowing fine-grained control over state management.
  • Observer Pattern: Features a built-in subscription system that lets components listen for state changes and re-render as needed.
  • Web Worker Support: Runs seamlessly in a web worker environment via Stockroom, improving performance for complex applications.
  • Data Selectors: Offers useful selectors to extract specific properties from the state, enhancing data handling within the application.
  • Provider Component: Wrap your application in a single Provider to expose the store, making state easily accessible throughout the component tree.