New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@acoustic-content-sdk/redux-store

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acoustic-content-sdk/redux-store

> TODO: description

  • 8.0.498
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

@acoustic-content-sdk/redux-store

Implementation of a Redux store with support for adding feature modules, dynamically.

Providing a feature module

Create and export an instance of ReduxFeatureModule for your module.

Example

import {
  ReduxFeatureModule,
  createReduxFeatureModule
} from 'prod-publishing-redux-store';

import { sampleEpic } from './feature.epics';
import { sampleReducer } from './feature.reducer';
import { SampleFeatureState } from './feature.state';

export const sampleFeature = createReduxFeatureModule(
  'SAMPLE_FEATURE',
  sampleReducer,
  sampleEpic
);

In some cases a feature module depends on the existence on other feature modules, e.g. because an epic might require it. In this case list the modules the feature modules depends on in the dependencies parameter:

import {
  ReduxFeatureModule,
  createReduxFeatureModule
} from 'prod-publishing-redux-store';

import { sampleEpic } from './feature.epics';
import { sampleReducer } from './feature.reducer';
import { SampleFeatureState } from './feature.state';

export const sampleFeature = createReduxFeatureModule(
  'SAMPLE_FEATURE',
  sampleReducer,
  sampleEpic,
  [depModule1, depModule2, depModule3]
);

Registering a feature module

Register the feature module with the root store using the addFeatureModule method. This will also register all dependent modules in topology order.

import {
  ReduxRootStore
} from 'prod-publishing-redux-store';

const store: ReduxRootStore = ...;

store.addFeatureModule(sampleFeature);

Consuming a feature module

Use the selectFeature method to create a selector for the desired feature.

Example

import { selectFeature } from 'prod-publishing-redux-store';

const selectSample = selectFeature(sampleFeature);

Side effects in Feature Modules

Feature modules may provide side effects (Epics) for asynchronous processing. Sometimes such epics require an initialization event to execute bootstrapping logic. The store sends an initialization event for this purpose, after a feature module has been initialized. Use the ofInitFeature method to subscribe to this event.

Example

import { ofInitFeature } from 'prod-publishing-redux-store';

const initEpic: Epic = (actions$) =>
  actions$.pipe(ofInitFeature(sampleFeature), map(...));

API Documentation

Refer to the API documentation.

Keywords

FAQs

Package last updated on 30 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc