Skip to content

Support injecting a custom argument #9

@jednano

Description

@jednano

Redux-thunk has a feature where you can inject a custom argument.

I think this library can support the same feature if it were implemented like so:

helpers/useThunkReducer.js

import { withExtraArgument } from 'react-hook-thunk-reducer';

import BrowserApp from '../BrowserApp';

export default withExtraArgument({ app: new BrowserApp() });

An implementation of this might look like thus:

const saveData = (dispatch, getState, { app }) => {
  app.localStorage.setItem('data', JSON.stringify(data));
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions