Neophobe Plebeian Mumpsimus

    @isogon/inject

    0.0.11 • Public • Published

    @isogon/inject

    @isogon/inject is a simple way to allow you to dispatch a function that gets injected later.

    import {
      createStore,
      applyMiddleware,
      compose,
    } from 'redux';
    import inject from '@isogon/inject';
     
    import reducer from './reducers'; // Your reducers
    import someHelper from './someHelper'; // Something you need in your actions
     
    const initialState = {};
    const middleware = applyMiddleware(inject({
      someHelper,
    });
    const store = compose(middleware)(createStore)(reducer, initialState);
     
    store.dispatch(({ someHelper }) => someHelper('DO_THE_THING'));

    Keywords

    none

    Install

    npm i @isogon/inject

    DownloadsWeekly Downloads

    1

    Version

    0.0.11

    License

    Unlicense

    Last publish

    Collaborators

    • dweedon
    • terribleplan
    • isogon_user