Class DataStorage
Constructors
constructor
-
Returns DataStorage
Methods
StaticRead Boolean
-
Reads a boolean from the data storage
Parameters
- key: string
The key to read
- defaultValue: boolean
The value if the key doesn't exist
Returns boolean
The boolean value
- key: string
StaticRead Json
StaticRead Number
-
Reads a number from the data storage
Parameters
- key: string
The key to read
- defaultValue: number
The value if the key doesn't exist
Returns number
The number value
- key: string
StaticRead String
-
Reads a string from the data storage
Parameters
- key: string
The key to read
- defaultValue: string
The value if the key doesn't exist
Returns string
The string value
- key: string
StaticWrite Boolean
-
Writes a boolean to the data storage
Parameters
- key: string
The key to write
- value: boolean
The value to write
Returns void
- key: string
StaticWrite Json
-
Writes a JSON value to the data storage
Type Parameters
- T
Parameters
- key: string
The key to write
- value: T
The JSON value to write
Returns void
StaticWrite Number
-
Writes a number to the data storage
Parameters
- key: string
The key to write
- value: number
The value to write
Returns void
- key: string
StaticWrite String
-
Writes a string to the data storage
Parameters
- key: string
The key to write
- value: string
The value to write
Returns void
- key: string
Class for storing data to local storage if available or in-memory storage otherwise