@mobx-sentinel/core
v0.5.0
Published
MobX library for non-intrusive class-based model enhancement. Acting as a sentinel, it provides change detection, reactive validation, and form integration capabilities without contamination.
Maintainers
Readme
mobx-sentinel/core
Core functionality for tracking changes to MobX observables and validating them.
Documentation: guide · API reference
@nestedannotation for tracking nested models.@nestedannotation supports objects, boxed observables, arrays, sets, and maps.@nested.hoistannotation can be used to hoist sub-fields in a nested model to the parent model.StandardNestedFetcher(low-level API) provides a simple but powerful mechanism for tracking and retrieving nested models. Allowing other modules (even your own code) to integrate nested models into their logic without hassle.
Watcherdetects changes in models automatically.- All
@observableannotations are automatically watched by default. @watchannotation can be used for@computedgetters, and for fields holding anobservable.box(),.array(),.map()or.set()instead of being annotated with@observable. e.g.,@watch readonly count = observable.box(0)@watch.refannotation can be used to watch values with identity comparison, in contrast to the default behavior which uses shallow comparison.@unwatchannotation andunwatch(() => ...)function disable change detection when you need to modify values silently.
- All
ValidatorandaddValidationprovide reactive model validation.- Composable from multiple sources.
- Both sync and async validations are supported.
- Async validations feature smart job scheduling and are cancellable with AbortSignal.
