RealtimeStoreCreateOptions
ClassThe options for the realtime store.
- Available on all platforms
Index
Properties
Methods
Example
// @input Asset.ConnectedLensModule connectedLensModule
var options = ConnectedLensSessionOptions.create();
script.connectedLensModule.createSession(options)
var initialStore = GeneralDataStore.create();
initialStore.putInt('state', 1);
var options = RealtimeStoreCreateOptions.create();
options.ownership = RealtimeStoreCreateOptions.Ownership.Unowned;
options.persistence = RealtimeStoreCreateOptions.Persistence.Session;
options.initialStore = initialStore;
session.createRealtimeStore(options,
function onSuccess(store) {
print('Store created! In On connected');
},
function onError(message) {
print('Unable to create a store: ' + message)
}
)
Extends
Properties
allowOwnershipTakeOver
allowOwnershipTakeOver:
boolean
Since
Lens Scripting Version 184
Default Value
false
initialStore
initialStore:
GeneralDataStore
An existing store to be used as the initial values for the real time store.
Since
Lens Scripting Version 173
Default Value
null
ownership
ownership:
Ownership
The ownership model for the realtime store.
Since
Lens Scripting Version 173
Default Value
RealtimeStoreCreateOptions.Ownership.Owned
persistence
persistence:
Persistence
The persistence model for the realtime store.
Since
Lens Scripting Version 173
Default Value
RealtimeStoreCreateOptions.Persistence.Ephemeral
storeId
storeId:
string
Writes an id string to the store that can be used to identify it later.
Since
Lens Scripting Version 181
Default Value
""
Methods
create()
staticcreate():RealtimeStoreCreateOptions
Creates the realtime store options object.
Returns
RealtimeStoreCreateOptions
Since
Lens Scripting Version 173
getTypeName()
staticgetTypeName():TypeName<RealtimeStoreCreateOptions>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<RealtimeStoreCreateOptions>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
Nested types
Enumerations
| Enumeration | Description |
|---|---|
| Ownership | The ownership model of a realtime store. |
| Persistence | The persistence model for a realtime store. |