Creates a new values store
Initial session data or null
Returns true if the store is empty
Returns true if the store has been modified
Checks if a value exists. Includes extra guards to check arrays for length.
The key or key path to check
Whether to check array length (default: true)
Sets a key/value pair in the store
The key or key path to set
The value to set
Pulls value from the store. Same as calling store.get then store.unset.
The key or key path to pull
OptionaldefaultValue: any
Default value if key doesn't exist
Increments a numeric value. Raises an error when underlying value is not a number.
The key or key path to increment
Number of steps to increment (default: 1)
Decrements a numeric value. Raises an error when underlying value is not a number.
The key or key path to decrement
Number of steps to decrement (default: 1)
Session store encapsulates the session data and offers a declarative API to mutate it.
Example