Skip to main content

Configuration

The store configuration allows you to customize the behavior of your store upon creation. Therefore, the configuration is applied by passing it to the constructor. Since signalstory is a multi store state management library, each store can have its own configuration.

Here are the available configuration options:

OptionDescriptionDefault ValueRequired
initialStateSpecifies the initial state of the store.-Yes
nameSets the name of the store. This option is optional and defaults to the constructor name.Class nameNo
injectorOptional DI injector that can be passed for effects and query objects. Only useful for dynamic stores not registered in DI.nullNo
pluginsA list of plugins to use with the store.[]No

class MyStore extends Store<MyState> {
constructor() {
super({
initialState: { ... },
name: 'My Store',
plugins: [
useDevtools(),
useStoreHistory(),
useStorePersistence(),
],
});
}
}