reactivity API
@elfui/reactivity is a responsive portal that can be used independently. Application and macro components are first imported from @elfui/core; only when you really need to use the reactive system without component runtime, you can directly rely on this package.
Stable application API
state
useRef、useReactive、useShallowRef、useShallowReactive
Derivations and side effects
useComputed、useEffect、watch、onWatcherCleanup
Use useEffect() for automatically tracked effects and watch() for explicit sources, old/new values, deep, or immediate behavior.
Scheduling
nextTick、queueJob、queuePostFlushJob、flushSync
tool
readonly、isReadonly、isState、isRef、isReactive、isProxy、markRaw、toRaw、unref、toValue
Scope
effectScope、getCurrentScope、onScopeDispose
High-level low-level API
WARNING
The following symbols are publicly exported and are mainly used by framework extensions, adapters and diagnostic tools; ordinary business code should not directly call or rely on their internal state.
- effect:
effect、stop、ReactiveEffect、isTracking、pauseTracking、resetTracking、untrack - Dependency graph:
track,trigger,triggerAll - scope internals:
EffectScope、recordEffectScope - scheduler internals:
isSyncMode - state flags:
REACTIVE_FLAG、REF_FLAG、STATE_FLAG
TIP
These APIs are still subject to the beta version; they are not recommended APIs for the @elfui/core main entrance. If they are adjusted in the future, they will be separately stated in the change record of @elfui/reactivity.
