External module "ancient-cursor/src/lib/cursor"
Functions
apply
- apply(cursor: any, bundle: any): void
mixin
- mixin<T>(superClass: T): any
-
Type parameters
Parameters
Returns any
spray
-
Parameters
Returns function
watch
- watch(__namedParameters: object, paths: TBundlePaths, listener: function): void
-
Parameters
-
__namedParameters: object
-
-
bundlePath: string[]
-
data: any
-
newValue: any
-
-
listener: function
Returns void
Apply bundle to cursor and emit 'changed' event.
import { Cursor, apply } from 'ancient-cursor/lib/cursor'; const cursor = new Cursor(); cursor.exec(true, { a: [{ b: { c: 'd' } }] }); cursor.data; // { a: [{ b: { c: 'd' } }] } apply( cursor, { type: 'set', path: 'a.0', value: { d: { e: 'f' } }, }); cursor.data; // { a: [{ d: { e: 'f' } }] }