Redux Tween has these defaults:
- transition duration is 250ms;
- transition has no delay;
- cubic easing is applied;
- every action results in transition, none of actions applies immediately.
To override this defaults setup Redux Tween by providing additional arguments to tweenActionCreators
or tweenStore
.
// use one of d3 easings or write your own
import {easePolyIn as ease} from 'd3-ease';
const duration = ({action, state, nextState}) => {
// calculate duration
return action.desiredDuration;
};
const delay = ({action, state, nextState}) => {
// calculate delay
return action.desiredDelay;
};
// or just
const duration = 750;
const delay = 50;
// and we're good to go
const transitionSetup = {ease, duration, delay};
const actionFilter = action => !action.immediate;