R.Store.MemoryStore Class
Implementation of R.Store using a traditionnal, Flux-like memory-based Store. The store is read-only from the components,
but is writable from the toplevel using "set". Wire up to a R.Dispatcher.MemoryDispatcher to implement the canonical Flux.
Item Index
Methods
Methods
destroy
()
Clean UplinkStore store
fetch
-
key
Fetch data according to a key
Parameters:
-
key
StringThe key
Returns:
fn the yielded fonction
get
-
key
Return data according to a key
Parameters:
-
key
StringThe key
Returns:
fn the yielded fonction
serialize
()
String
Serialize the UplinkStore store
Returns:
data The serialized UplinkStore store
set
-
key
-
val
Set data according to a key, then call signalUpdate in order to rerender matching React component
Parameters:
-
key
StringThe key
-
val
ObjectThe val
signalUpdate
-
key
Triggered by the set function.
Fetch data according to the given key.
Call the saved function contained in subscribers.
Parameters:
-
key
StringThe key to fetch
sub
-
key
-
_signalUpdate
Subscribe at a specific key
Parameters:
-
key
StringThe specific key to subscribe
-
_signalUpdate
Functionthe function that will be call when a data corresponding to a key will be updated
Returns:
subscription The saved subscription
unserialize
-
str
Unserialize the MemoryStore store
Parameters:
-
str
StringThe string to unserialise
unsub
-
subscription
Unsubscribe
Parameters:
-
subscription
ObjectThe subscription that contains the key to unsuscribe