Vizel API / core/src / createVizelEditorTransactionStore
Function: createVizelEditorTransactionStore()
ts
function createVizelEditorTransactionStore(getEditor): VizelEditorTransactionStore;Defined in: packages/core/src/controllers/transactionStore.ts:43
Create a VizelEditorTransactionStore that observes whichever editor getEditor currently returns. The factory is framework-agnostic; each framework wraps the store in its native reactivity primitive.
Parameters
| Parameter | Type |
|---|---|
getEditor | () => Editor | null | undefined |
Returns
Example
tsx
// React adapter via useSyncExternalStore:
const store = createVizelEditorTransactionStore(() => editor);
useSyncExternalStore(store.subscribe, store.getVersion, store.getVersion);