Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tempo-store

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tempo-store

Super simple state management library

  • 1.0.2
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-27.78%
Maintainers
1
Weekly downloads
 
Created
Source

tempo-store

tempo-store contains utilities to wrap a value into a Store instance and track its lifecycle.

Property

A Property instance wraps a single generic value of type T. It exposes a field observable where you can add your own listeners. These will be triggered any time Property.set is invoked but only if the value differs from its previous state. To control such behavior it is possible to pass a function equal. The default implementation performs a structural equality test.

Store

A Store instance wraps a property and adds a reducer function to the mix. With the reducer it is possible to influence the value of store by invoking process(action: Action). Whenver that method is called, reducer(currentState: State, action: Action): State is invoked and the value of store is accordinlgy updated. It is possible to monitor state changes and action triggers by adding listeners to the observable field. Note that these listeners should have the shape (state: State, action: Action, changed: boolean) => void.

More info on the tempo architecture can be found here.

Keywords

FAQs

Package last updated on 23 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc