API
As of v7.0.0
cache
is a property provideing access to the underlying immutable cache managed by this context.
closed
is a boolean property confirming that the context is still active.
Use the "closing" event to be notified right before context deactivation.
Please see the dispose method below.
connect
is a function property of the React Observable Context object, accepting an optional selector map parameter; and returning a reusable connector function.
The connector function takes a client as a parameter and returns an HOC.
Any client intending to observe similar selector map from within the context object may be passed to this connector.
The HOC injects the context's change stream store to the client and handles all of the context usage requirements.
The injected store monitors changes in the underlying state slices referenced by the selector map.
A change in any of the referenced state slices automatically triggers an update of the related
store.data property and a subsequent render of the client.Any prop name conflicts between the injected store properties and the client's own props are resolved in favor of the client's own props. Such a scenario may be remedied by renaming the conflicting key within the selector map.
createEagleEye
is a function accepting three optional parameters (to wit: the initial state object or an AutoImmutable instance bearing this initial state object, the prehooks and the storage) and returning a React Observable Context object.
The returned object is the store-bearing context.
The context's store is directly accessible through its
store property.dispose
is a context method to deactivates this context.
Context deactivation is permanent.
The context's
closed property confirms this status.UsageError
deprecated.
useStream
is a property of the React Observable Context object which can be expressed as a react hook.
It accepts an optional selector map parameter; and returns a change stream context store.
The injected store monitors changes in the underlying state slices referenced by the selector map.
A change in any of the referenced state slices automatically triggers an update of the related
store.data property and a subsequent render of the client.The context's connect property function is axiomatically the more conducive method for consuming this conetxt.
In certain user-specific cases, direct access to this method may be preferrable.
In such cases, it is advisable to wrap the client in a
React.memo() if needed.