lightweight-state-manager
Reactive icon

Lightweight State Manager

Stable version 0.1.0 (Compatible with OutSystems 11)
Uploaded
 on 28 Feb (19 hours ago)
 by 
0.0
 (0 ratings)
lightweight-state-manager

Lightweight State Manager

Documentation
0.1.0

After importing the StateManager_Lib, it will provide Blocks that can be imported into your application. 

The library provides two kinds of states, Atoms and Maps. The state can be persisted across screens as long as the page is not refreshed.


Atoms:

Atoms are single value items. The library currently stores them as text, but you can convert other single formats to text before storing them.

Maps:

Maps are a flat key-value structure. They allow storing the whole structure and then listening for changes on the whole structure or specific keys.


Subscribe

Automatically grab the latest value that is in the store.

Listen

Begins subscribing to the store but only grabs the value the first time the store changes.

CreateAtom/CreateMap

This will create the store and add the object.

RemoveStore

Deletes the store.

CheckStore

Checks if the store has a value. It will keep checking for a few retries (in case another component is loading at the same time and hasn't initialized yet).


The following blocks are available depending on your subscription method and object type.

  • SubscribeAtom
  • ListenAtom
  • SubscribeMap
  • ListenMap
  • SubscribeKeys
  • ListenKeys