Skip to content

Latest commit

History

History
44 lines (33 loc) 路 913 Bytes

BASIC.md

File metadata and controls

44 lines (33 loc) 路 913 Bytes

Basic integration

To use Redux Tween:

  1. Enhance store.
  2. (Optional) Define transition setup and action filter.

Enhancing store

import {createStore, applyMiddleware, compose} from 'redux';
import {tweenStore} from 'redux-tween';

const enhancer = compose(
  applyMiddleware(...middlewares),
  tweenStore()
);

const store = createStore(reducer, enhancer);

Defining transition setup and action filter

Define transitionSetup and/or actionFilter as described here and use them:

// pass your setup like this:
const enhancer = compose(
  applyMiddleware(...middlewares),
  tweenStore(transitionSetup, actionFilter)
);

// if you want just setup:
const enhancer = compose(
  applyMiddleware(...middlewares),
  tweenStore(transitionSetup)
);

// if you want just filter:
const enhancer = compose(
  applyMiddleware(...middlewares),
  tweenStore({}, actionFilter)
);