Home > @uniformdev/context > TransitionDataStore
TransitionDataStore class
Signature:
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
Partial<VisitorData> | undefined | ||
|
|
{ on: { <Key extends "dataUpdatedAsync">(type: Key, handler: mitt.Handler<TransitionDataStoreEvents>): void; }; } |
Subscribe to events from the transition storage | |
|
|
Partial<VisitorData> | undefined |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Deletes a visitor's stored data, forgetting them. | ||
|
When we load on the client side after a server side rendering has occurred (server to client transition), we can have a page script (ID: __UNIFORM_DATA__) that contains the computed visitor data from the SSR/edge render. This data is injected into the first render to allow score syncing and the server to request commands be applied to the client side data store. | ||
|
|
Deletes a visitor's stored data, forgetting them. Important: do not emit any async score update events from this function. | |
|
|
Updates visitor data in the transition store. NOTE: The updated data is optimistically stored in TransitionDataStore automatically, so unless the updated data is _changed_ by the backend data store, there is no need to emit async score changed events when the visitor data is done updating. | |
|
| ||
|
Updates data in the transition storage. |