3.0.2 • Published 3 years ago
@statewalker/store-ui v3.0.2
@statewalker/store-ui: UI binding for Stores
This module provides binding between Stores (@statewalker/store) and DOM elements.
Methods:
extendInputStore(store)- the main method of this library; it binds two additional store methods:store.bindView(view, keys, action)- binds the givenviewDOM object to store values corresponding to the givenkeys; if theviewis not defined then a newdivelement is created; it uses internally thebindStoreView(..)method described belowstore.bindStoreInput(key, configKey, input)- binds the store values corresponding to thekeyparameter to input instances returned by theinputfunction; if theconfigKeyparameter is defined then theinputis called each time when these dependencies are changed
bindStoreView(store, view, keys, action)- bind aview(a DOM element) to thestore; the specifiedactionallows to update thevieweach time when some fields (defined by thekeysparameters) change its value.bindStoreInput(store, key, input)- synchronizes the giveninputto thestorefield defined by thekeyparameter; an input is a DOM element with thevalueproperty and rising the "input" event when user updates values; see the ObservableHQ inputs library (GitHub) for more information.bindConfigurableStoreInput(store, configKey, valueKey, input)- binds input values to a specific field of thestoredefined by thevalueKeyparameter; theinputfunction should return a new input instance and it is called each time when theconfigKeyfield of thestorechanges its values
Used libraries in GitHub:
For working examples see this Observable Notebook: