Main data structure used in dataStore
Type parameters
| Name |
|---|
T |
Table of contents
Properties
Properties
allowed
• allowed: readonly T[] | (d: T) => boolean
Allowed settings (can be string, array or function returning true/false )
asyncSet
• Optional asyncSet: (...args: unknown[]) => Promise<T>
Setter function - asynchronous (will be run before value is set)
Type declaration
▸ (...args): Promise<T>
Setter function - asynchronous (will be run before value is set)
Parameters
| Name | Type |
|---|---|
...args | unknown[] |
Returns
Promise<T>
compare
• Optional compare: <K>(obj: K | K[], obj2?: K | K[]) => boolean
Validity compare function
Type declaration
▸ <K>(obj, obj2?): boolean
Validity compare function
Type parameters
| Name | Type |
|---|---|
K | T |
Parameters
| Name | Type |
|---|---|
obj | K | K[] |
obj2? | K | K[] |
Returns
boolean
def
• def: T
Default value
nativeCloudSync
• Optional nativeCloudSync: boolean
If false iOS/Android will set this value if exist, and value will not be stored if is null or undefined
nativeSync
• Optional nativeSync: boolean
Store the value to native iOS/Android mobile app stores
readOnly
• Optional readOnly: boolean
This item can be set only by syncSet or asyncSet (so basically it is derived store) This so far does not do anything, it's merely a flag for developer
save
• Optional save: boolean
Persistent item. Save this item to localStorage
sync
• Optional sync: boolean
Sync this item with cloud
syncSet
• Optional syncSet: (...args: unknown[]) => T
Setter function (will be run before value is set)
Type declaration
▸ (...args): T
Setter function (will be run before value is set)
Parameters
| Name | Type |
|---|---|
...args | unknown[] |
Returns
T
update
• Optional update: number
Timestamp of last item update
watchSync
• Optional watchSync: boolean
If this is true, the value is sent to the Watch. Now only works for iOS and Apple Watch Note: The implementation for the key/value sent needs to be done on the native site too