You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `FROM_LORO` — changes applied from the Loro document
56
56
- `TO_LORO` — changes produced by `setState`
57
57
- `BIDIRECTIONAL` — manual/initial sync context
58
-
- Mirror ignores events with origin `"to-loro"`to prevent feedback loops.
58
+
- Mirror suppresses document events emitted during its own `setState` commits to prevent feedback loops; provide `origin`, `timestamp`, or `message` when you need to tag those commits.
59
59
- Initial state precedence: defaults (from schema) → `doc` snapshot (normalized) → hinted shapes from `initialState` (no writes to Loro).
60
60
- Trees: mirror state uses `{ id: string; data: object; children: Node[] }`. Loro tree `meta` is normalized to `data`.
61
61
-`$cid` on maps: Mirror injects a read-only `$cid` field into every LoroMap shape in state. It equals the Loro container ID, is not written back to Loro, and is ignored by diffs.
Copy file name to clipboardExpand all lines: packages/core/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ Trees are advanced usage; see Advanced: Trees at the end.
82
82
- Methods:
83
83
- getState(): Current state
84
84
- setState(updater | partial, options?): Mutate a draft or return a new object. Runs synchronously so downstream logic can immediately read the latest state.
85
-
- options: `{ tags?: string | string[]}`(surfaces in subscriber metadata)
85
+
- options: `{ tags?: string | string[]; origin?: string; timestamp?: number; message?: string }`— tags surface in subscriber metadata; commit metadata is forwarded to the underlying Loro commit.
0 commit comments