Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fusion-plugin-redux-observable

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fusion-plugin-redux-observable

FusionJS plugin for redux-observable.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

fusion-plugin-redux-observable

Installs the redux-observable middleware and runs the provided epic.


Table of contents


Installation

yarn add fusion-plugin-redux-observable

Usage

// epic.js
// plain ol' epic
import { ofType } from 'redux-observable';
import { delay, mapTo } from 'rxjs/operators';
import { PING, pong } from './actions';

export default action$ =>
  action$.pipe(
    ofType(PING),
    delay(1000),
    mapTo(pong()),
  );

Setup

// main.js
import React from 'react';
import Redux, {
  ReduxToken,
  ReducerToken,
  EnhancerToken,
  GetInitialStateToken,
} from 'fusion-plugin-react-redux';
import EpicEnhancer, { EpicToken, EpicEnhancerToken } from 'fusion-plugin-redux-observable';
import App from 'fusion-react';
import { createPlugin } from 'fusion-core';
import { compose } from 'redux';
import reducer from './reducer';
import epic from './epic';

export default () => {
  const app = new App(root);
  app.register(ReduxToken, Redux);
  app.register(ReducerToken, reducer);
  app.register(EpicToken, epic);
  app.register(EpicEnhancerToken, EpicEnhancer);
  app.register(EnhancerToken, createPlugin({
    deps: { epicEnhancer: EpicEnhancerToken },
    provides: ({ epicEnhancer }) => compose(epicEnhancer),
  }));
  __NODE__ && app.register(GetInitialStateToken, async ctx => ({}));
}

API

Registration API
EpicEnhancer
import EpicEnhancer from 'fusion-plugin-redux-observable';

The redux-observable enhancer. Installs middleware and runs required epic registered to EpicToken. Typically registed to EpicEnhancerToken

EpicEnhancerToken
import { EpicEnhancerToken } from 'fusion-plugin-redux-observable';

Typically registered with EpicEnhancer

Dependencies
EpicToken
import { EpicToken } from 'fusion-plugin-redux-observable';

The root epic. Required.

FAQs

Package last updated on 22 Aug 2018

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