GitHub package.json versionTypeScriptNPM
GitHub package.json versionTypeScriptNPM
Latest

API

cache

is a property providing access to the underlying immutable cache managed by this React Eagle Eye instance.

Note:

On React Eagle Eye Universe Instance.

The getObservableAt(...) method of this instance may be used to obtain a React Eagle Eye instance, provisioned by this instance, whose cache property is sought.

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.

Note:

On React Eagle Eye Universe Instance.

The getObservableAt(...) method of this instance may be used to obtain a React Eagle Eye instance, provisioned by this instance, whose closed flag is under examinaton.

connect

is a function property of the React Eagle Eye instance, 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 React Eagle Eye instance 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.

Note:

React Eagle Eye Universe Equivalent.

The stream(...) function property is the React Eagle Eye Universe instance connect(...) equivalent. This function returns an object whose into(...) method serves as the connector.

createEagleEye (SSR mode: createEagleEyeUniverse)

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 Eagle Eye instance.
The returned instance is the store-bearing context.
The context's store is directly accessible through its store property.
A change stream store for this context can be obtained either by utilizing its connect (or stream in SSR mode) function property or by expressing its useStream property as a react component hook.

Note:

On React Eagle Eye Universe Instance.

This instance produced by the createEagleEyeUniverse(...) serves to manage React Eagle Eye instances' availability and dispensaton in shared environments.

dispose

is a context method to deactivate this context.
Context deactivation is permanent.
The context's closed property confirms this status.

Note:

On React Eagle Eye Universe Instance.

The getObservableAt(...) method of this instance may be used to obtain for disposal a React Eagle Eye instance provisioneed by this instance.

Provisioning

is a feature of the React Eagle Eye Universe class dispensed through the two following properties:

provide(...)

a method for making a React Eagle Eye instance available to the application environment.
when an existing instance is supplied, makes it available; returns an identifier for it.
when no instance is supplied, makes a new one available; returns an identifier for it.

<Provider />

a declarative component property equivalent of the aforementioned provide(...) method.
makes React Eagle Eye instance available to the React component tree.
when an identifier to an existing instance is supplied, makes the identified instance available to the component tree; holds the identifier in the targetId property of its ref prop.
when an existing instance is supplied, makes it available to the component tree; holds the identifier in the targetId property of its ref prop.
when no instance is supplied, makes a new one available to the component tree; holds the identifier in the targetId property of its ref prop.
The free(...) method provides a means for the manual decommission of React Eagle Eye instances provisioned by its React Eagle Eye Universe instance.
NOTE: This may not be necessary for the majority of cases. React Eagle Eye Universe instances work cooperatively OOB with the system GC process to coordinate automatic cleanup activities.
The free(...) method only decommissions by default non-streaming React Eagle Eye instances provisioned by its instance.
With its force flag argument set, it can preemptively decommission actively streaming instances provisioned by its instance as well.
Only set this flag when sure that parts of the system dependent on the stream provided by the decomissioned instance are protected.

UsageError

deprecated.

useStream

is a property of the React Eagle Eye instance 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.