Abstract base class for state provider implementations. The provider is responsible
for setting values and extracting values to/from the underlying storage source. The
storage source can vary and the details should be implemented in a subclass. For example
a provider could use a server side database or the browser localstorage where supported.
This class provides methods for encoding and decoding
typed variables including
dates and defines the Provider interface. By default these methods put the value and the
type information into a delimited string that can be stored. These should be overridden in
a subclass if you want to change the format of the encoded value and subsequent decoding.
a -> Array
n -> Number
d -> Date
b -> Boolean
s -> String
o -> Object
-> Empty (null)
a -> Array
n -> Number
d -> Date
b -> Boolean
s -> String
o -> Object
-> Empty (null)
clear(
String name ) : Void
Clears a value from the state
Clears a value from the state
Parameters
- name : String
The key name
Returns
Decodes a string previously encoded with encodeValue.
Decodes a string previously encoded with
encodeValue.
Parameters
- value : String
The value to decode
Returns
Encodes a value including type information. Decode with decodeValue.
Encodes a value including type information. Decode with
decodeValue.
Parameters
- value : Mixed
The value to encode
Returns
get(
String name, Mixed defaultValue ) : Mixed
Returns the current value for a key
Returns the current value for a key
Parameters
Returns
set(
String name, Mixed value ) : Void
Sets the value for a key
Sets the value for a key
Parameters
- name : String
The key name
- value : Mixed
The value to set
Returns
Fires when a state change occurs.
Fires when a state change occurs.
Parameters
Returns