Overview
The WeaveStoreStandalone is a client/server-side class in Weave.js Standalone store that provides a way to directly render a Room without any of the overhead of the collaboration, useful for example when server-side rendering a room for exporting it to an image.
Parameters
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
|
Required |
The room to load |
|
|
|
|
Array of nodes to register and use by the instance |
TypeScript types
type FetchInitialState = (doc: Y.Doc) => void;
type WeaveStoreStandaloneParams = {
roomData: string;
initialState?: FetchInitialState;
};
Shared-state initial value
If not defined the defaultInitialState is used, which is nothing more than:
-
gridLayer: is the layer used by WeaveStageGridPlugin to render the reference grid elements.
-
mainLayer: is the main layer where all the nodes added by the users live.
-
selectionLayer: is the layer used by WeaveNodesSelectionPlugin to render the selection overlay elements.
-
usersPointersLayer: is the layer used by WeaveUsersPointersPlugin to render the users pointers overlay elements.
-
utilityLayer: is a wildcard layer defined that can be used by any plugin.
Check out here the code
hat defines the defaultInitialState function.