How to use the redux-logic.default function in redux-logic

To help you get started, we’ve selected a few redux-logic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeffbski / redux-logic-test / examples / nodejs-basic / index.js View on Github external
const expect = require('expect');
const createMockStore = require('redux-logic-test').default.createMockStore;
const createLogic = require('redux-logic').default.createLogic;

const fooLogic = createLogic({
  type: 'FOO',
  process(deps, dispatch, done) {
    const API = deps.API;
    API.get()
       .then(results => {
         dispatch({ type: 'FOO_SUCCESS', payload: results });
         done();
       });
  }
});

const api = {
  get() { return Promise.resolve(42); }
};

redux-logic

Redux middleware for organizing all your business logic. Intercept actions and perform async processing.

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis