Application code for holding feature toggle state
Interfaces
Members
(static) globalFeaturesStore
- Implements:
(static) reactContextFeaturesStore
- Implements:
(static) requestScopedFeaturesStore
- Implements:
(static) ssrBackedReactContextFeaturesStore
- Implements:
Methods
(static) globalFeaturesStoreFactory() → {module:web-toggle-point-features.globalFeaturesStore}
A factory function used to create a store for features, held globally in the application.
This is a singleton, and should not be used server-side for anything user or request specific.
A thin wrapper around a singleton, used as an extension point for future plugins.
Consider deep freezing the value to prevent accidental mutation, if this is intended to be static.
For reactive decisions, consider implementing something that allows for reactivity e.g. a valtio/vanilla proxy, and subscribe appropriately in a toggle point.
Returns:
A store for features, held globally in the application.
(static) reactContextFeaturesStoreFactory() → {module:web-toggle-point-features.reactContextFeaturesStore}
A factory function used to create a store for features, held in a React context.
A thin wrapper around a context, used as an extension point for future plugins.
Returns:
A store for features, held within a React context.
(static) requestScopedFeaturesStoreFactory() → {module:web-toggle-point-features.requestScopedFeaturesStore}
A factory function used to create a store for features, held in request-scoped global value.
Should only be used server-side, for anything user or request specific.
A thin wrapper around node AsyncLocalStorage, used as an extension point for future plugins.
Returns:
A store for features, scoped for the current request.
(static) ssrBackedReactContextFeaturesStoreFactory() → {module:web-toggle-point-features.ssrBackedReactContextFeaturesStore}
A factory function used to create a store for features, held in a React context, backed by server-side rendering.
A wrapper around a reactContextFeaturesStore, with server-side rendering supplied by the toggle-point-ssr package.
Returns:
A store for features, held within a React context.