Constructor
new StateContainer(initialState)
Initializes the initial state by copying the provided object
Parameters:
Name | Type | Description |
---|---|---|
initialState |
Object |
Methods
(static) from(serializedState) → {StateContainer}
Static constructor from serialized state
Parameters:
Name | Type | Description |
---|---|---|
serializedState |
Buffer |
Returns:
- Type
- StateContainer
delete(key) → {*}
Deletes a key, value pair
Parameters:
Name | Type | Description |
---|---|---|
key |
* |
Returns:
Returns the value
- Type
- *
get(key) → {*}
Fetches a value from a key
Parameters:
Name | Type | Description |
---|---|---|
key |
* |
Returns:
Returns the removed object
- Type
- *
pack() → {Buffer}
Serializes a StateContainer into a Buffer
Returns:
- Type
- Buffer
set(key, value) → {*}
Sets a key, value pair
Parameters:
Name | Type | Description |
---|---|---|
key |
* | |
value |
* |
Returns:
Returns the value
- Type
- *