@revolist/revogrid / ObservableMap
Interface: ObservableMap<T>
Type Parameters
Type Parameter |
---|
T |
Properties
Property | Type | Description | Defined in |
---|---|---|---|
get | Getter <T > | Only useful if you need to support IE11. Example const { state, get } = createStore({ hola: 'hello', adios: 'goodbye' }); console.log(state.hola); // If you don't need to support IE11, use this way. console.log(get('hola')); // If you need to support IE11, use this other way. | src/utils/store.types.ts:53 |
on | OnHandler <T > | Register a event listener, you can listen to set , get and reset events. Example store.on('set', (prop, value) => { console.log( Prop ${prop} changed to: ${value}); }); | src/utils/store.types.ts:71 |
onChange | OnChangeHandler <T > | Easily listen for value changes of the specified key. | src/utils/store.types.ts:75 |
set | Setter <T > | Only useful if you need to support IE11. Example const { state, get } = createStore({ hola: 'hello', adios: 'goodbye' }); state.hola = 'ola'; // If you don't need to support IE11, use this way. set('hola', 'ola')); // If you need to support IE11, use this other way. | src/utils/store.types.ts:62 |
state | T | Proxied object that will detect dependencies and call the subscriptions and computed properties. If available, it will detect from which Stencil Component it was called and rerender it when the property changes. Note: Proxy objects are not supported by IE11 (not even with a polyfill) so you need to use the store.get and store.set methods of the API if you wish to support IE11. | src/utils/store.types.ts:44 |
Methods
dispose()
ts
dispose(): void
Resets the state to its original state and signals a dispose event to all the plugins.
This method is intended for plugins to reset all their internal state between tests.
Returns
void
Defined in
forceUpdate()
ts
forceUpdate(key: keyof T): any
Force a rerender of the specified key, just like the value changed.
Parameters
Parameter | Type |
---|---|
key | keyof T |
Returns
any
Defined in
reset()
ts
reset(): void
Resets the state to its original state.
Returns
void
Defined in
use()
ts
use(...plugins: Subscription<T>[]): () => void
Registers a subscription that will be called whenever the user gets, sets, or resets a value.
Parameters
Parameter | Type |
---|---|
...plugins | Subscription <T >[] |
Returns
Function
Returns
void