Module: Library/State

State management library

All functions that are related to state management

State as a singleton can be accessed anywhere in the application by a simple require, making it very simple to check the current state. State should be the ONLY mutated object in the app. Its properties will be replaced by updated ones over and over again during the app lifecycle, ensuring that all functions remain pure.

Source:

Methods

(static) get(path) → {Any}

State getter

Parameters:
Name Type Description
path String

Path to retrieve

Source:
Returns:

Value located at path in this module

Type
Any

(static) set(path, value) → {Void}

State setter

Parameters:
Name Type Description
path String

Path to create/update

value Any

Value to create/update

Source:
Returns:

Nothing

Type
Void

(static) update(path, value) → {Void}

State updater (only set if the property already exists)

Parameters:
Name Type Description
path String

Path to update

value Any

Value to update with

Source:
Returns:

Nothing

Type
Void