Usage without schema
Usage with schema
Schema.decodeUnknownSync. Invalid entries are discarded.
Element depth limit
ORSet elements must be scalars or single-level objects/arrays (depth ≤ 1). Nested structures are rejected by the server:400 error with the message ORSet element nesting depth X exceeds maximum 1. This limit is enforced at the server level and cannot be bypassed.
API
| Method | Description |
|---|---|
add(value: T) | Add an element |
remove(value: T) | Remove all observed instances of an element |
has(value: T) | Returns true if the element is currently in the set |
elements() | Returns current elements as T[] |
onChange(fn) | Subscribe — returns unsubscribe function |
stream() | Returns an Effect Stream<T[]> that emits on every change |