// @flow
import type { State, Props } from '../animate';
import mapSequenceOverProps from './mapSequenceOverProps';

export default function attributesGenerator(props: Props, { willComplete, shouldMount }: State): Object {
  const { animationStates, sequenceId, sequenceIndex } = props;
  const id = sequenceId || sequenceIndex;
  const {
    play,
    startStyle,
    endStyle,
    onCompleteStyle,
    durationSeconds = 0.3,
    delaySeconds = 0,
    easeType = 'linear',
    className,
    reverseDurationSeconds = 0,
    reverseDelaySeconds = 0,
    unMount,
    mount,
    forwardedRef,
  } = mapSequenceOverProps(props, id);
  let style = startStyle;
  let transition = `all ${durationSeconds}s ${easeType} ${delaySeconds}s`;
  const willMountOrUnMount = unMount || (mount && !shouldMount);

  if (!willMountOrUnMount) {
    if (willComplete && onCompleteStyle && play) {
      style = onCompleteStyle;
      transition = '';
    } else if (
      mount ||
      play ||
      ((id || id === 0) &&
        Object.keys(animationStates).length &&
        animationStates[id] &&
        animationStates[id].play)
    ) {
      style = endStyle;
    } else if (!play && (reverseDurationSeconds || reverseDelaySeconds)) {
      transition = `all ${durationSeconds || reverseDurationSeconds}s ${easeType} ${reverseDelaySeconds}s`;
    }
  }

  return {
    className,
    style: {
      ...style,
      transition,
    },
    ref: forwardedRef,
  };
}

@@ -1234,33 +1234,40 @@
 sition = %60all $%7B
-d
+reverseD
 urationSeconds %7C
@@ -1268,24 +1268,17 @@
 onds %7C%7C 
-reverseD
+d
 urationS

fix a bug for reverseDurationSeconds