observe
(see Getting Started), which you can use to observe Redux from inside your aperture
.store.observe
takes one argument, which can be either a string or a function.store.observe
returns a stream of actions dispatched to your store which have that string as their action type.ping$
will receive any action with a type of PING
which gets dispatched to your store, and pong$
will receive any action with a type of PONG
which gets dispatched to your store.store.observe
will treat it as a Redux selector, and return a stream which subscribes to the state using your function, initialised with the selector's current value. Any time the selected slice of state changes, its new value will be piped to your stream if changed (===
comparison).balance$
will receive a new value every time the user's balance changes.initialProps
to source the username, we can select the slice of state dynamically: