message: Moved target into move to avoid early refactor
diff: @@ -15,17 +15,10 @@ class Motion extends React.Component {
  }
  move() {
  this.setState(({items: prevItems, update}) => {
  - var items = target(prevItems, this.props);
  - // Interpolate styles
  - this.moveId = requestAnimationFrame(this.move);
  - return {items};
  - })
  - }
  - target(items, {data, enter, leave}) {
  - // Set destinations
  + var {data, enter, leave} = this.props;
  var dataByKey = data.reduce((acc, dataItem) => ({...acc, [dataItem.key]: dataItem}), {});
  var itemsByKey = items.reduce((acc, item) => ({...acc, [item.key]: item}), {});
  - return items
  + var items = prevItems
  .map(item => {
  var end = !dataByKey[item.key] ? leave(item.data) : update(item.data);
  const equal = areEqual(item.end, end);
  @@ -41,6 +34,9 @@ class Motion extends React.Component {
  return {...dataItem, end, interpolators, progress: 0, tick: false};
  })
  );
  + this.moveId = requestAnimationFrame(this.move);
  + return {items};
  + })
  }
  areEqual(from, to) {
  if (Object.keys(from).length !== Object.keys(to).length)
  