store.observetakes one argument, which can be either a string or a function.
store.observereturns 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
PINGwhich gets dispatched to your store, and
pong$will receive any action with a type of
PONGwhich gets dispatched to your store.
store.observewill 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 (
balance$will receive a new value every time the user's balance changes.
initialPropsto source the username, we can select the slice of state dynamically: