External module "Observable"
Functions
Observable
Observable<T>( value: T ) : [ T , Emitter ]
Type parameters
Parameters
Private observeArray
observeArray<T>( arr: T , bus: Emitter , path?: string [] ) : T
Type parameters
Parameters
arr: T
Default value path: string [] = []
Returns T
Private observeObject
observeObject<T>( obj: T , bus: Emitter , path?: string [] ) : T
Type parameters
Parameters
obj: T
Default value path: string [] = []
Returns T
Legend
Module
Object literal
Variable
Function
Function with type parameter
Index signature
Type alias
Type alias with type parameter
Enumeration
Enumeration member
Property
Method
Interface
Interface with type parameter
Constructor
Property
Method
Index signature
Class
Class with type parameter
Constructor
Property
Method
Accessor
Index signature
Inherited constructor
Inherited property
Inherited method
Inherited accessor
Protected property
Protected method
Protected accessor
Private property
Private method
Private accessor
Static property
Static method
Returns a proxied object and an emitter which will emit 'added', 'changed' and 'deleted' events whenever changes are made to the returned proxy. Useful for a simple state store.
import { Observable } from 'goodish' const [o, bus] = Observable({ a: 1 }) bus.on('added', (path: string[], value: any) => {}) bus.on('deleted', (path: string[]) => {}) bus.on('changed', (path: string[], value: any) => {}) o.b = 2 // Fires 'added' event o.a = 2 // Fires 'changed' event delete o.a // Fires 'deleted' event o.a = undefined // Fires 'deleted' event