Configuring your app
To use the Aurelia Store plugin, you need to register it in your application's main configuration file (typically main.ts
or main.js
).
Here's how you do it:
Explanation:
import { initialState } from './state';
: Import theinitialState
object that you defined earlier.aurelia.use.plugin('aurelia-store', { initialState });
:This line registers the Aurelia Store plugin with your Aurelia application.
The
{ initialState }
object provides the initial state to the store. This is the starting point for your application's state.
With this configuration in place, the Aurelia Store plugin is ready to use, and your application's state will be initialized with the initialState
you provided.
Last updated
Was this helpful?