1.2.0 • Published 7 years ago

redux-thunk-state-adapter v1.2.0

Weekly downloads
6
License
MIT
Repository
-
Last release
7 years ago

redux-thunk-state-adapter

A utility to provide a facade of getState to an externally owned thunk. This is useful when you are sharing action creators which compose selectors that assume a certain state shape.

Usage

import { createThunkAdapter } from 'redux-thunk-state-adapter';
import { externalThunkCreator } from 'some-module';

// provide a transform function to map InternalState -> ExternalState
const externalThunkAdapter = createThunkAdapter((state) => ({
  user: {
    timezone: state.environment.userTimezone
  }
}));

const adaptedExternalThunk = externalThunkAdapter(externalThunkCreator);
1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago