Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / getSharedStore

Function: getSharedStore()

getSharedStore(): SharedStore

Defined in: flow/src/shared.ts:97

Get the active @shared room store (the in-process default, or whatever was installed via setSharedStore). Rarely needed in app code — @shared props read/write it automatically — but useful for tests or admin tooling that inspects room state directly.

Returns

SharedStore

The current SharedStore.

Example

// A collaborative counter: every subscriber to `room.lobby` converges on `count`.
class Counter extends Component {
  @shared("room.lobby") count = 0;
  @expose increment() { this.count++; } // written back + broadcast on commit
}