Fusion State Management
[WIP]
Fusion has simple state management built in. States are used in several standard components and can be seen in the Activator UI. This document will describe how it works and how it can be used in custom components.
How it is setup
Fusion States are setup with the Redux store built into a Fusion shared package.
Stateful mixin
How it is used
Examples of Fusion components with states
Popup
State container
State events
Internal Subscriptions
External Subscriptions
Fusion triggers an event that can be subscribed to in order to add functionality in custom JavaScript code when a state changes.
The event name is app.currentState
Example:
Fusion.subscribe('app.currentState', (data) => {
console.log('Current state was updated to', data.app.currentState);
});