Skip to content

Main data structure used in dataStore

Type parameters

Name
T

Table of contents

Properties

Properties

allowUrlRewrite

Optional allowUrlRewrite: boolean

Allow overwrite start-up URL TODO: Refactor. Used only once in router.ts


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
NameType
...argsunknown[]
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
NameType
KT
Parameters
NameType
objK | 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


save

Optional save: boolean

Peristent 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
NameType
...argsunknown[]
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