<commit_before>import {
  spawnChild,
  childrenSettled
} from './scheduler';


export default class TransitionContext {
  constructor(duration, insertedSprites, keptSprites, removedSprites) {
    this.duration = duration;
    this.insertedSprites = insertedSprites;
    this.keptSprites = keptSprites;
    this.removedSprites = removedSprites;
  }
  get insertedSprite() {
    return this.insertedSprites[0];
  }
  get keptSprite() {
    return this.keptSprites[0];
  }
  get removedSprite() {
    return this.removedSprites[0];
  }
  animate(motion) {
    if (motion.duration == null) {
      motion.duration = this.duration;
    }
    let self = this;
    return spawnChild(function *() {
      self.onMotionStart(motion.sprite);
      try {
        yield * motion._run();
      } finally {
        self.onMotionEnd(motion.sprite);
      }
    });
  }
  *_runToCompletion(transition) {
    yield * transition.call(this);
    yield childrenSettled();
  }
}<commit_msg>singular properties here considered harmful<commit_after>import {
  spawnChild,
  childrenSettled
} from './scheduler';


export default class TransitionContext {
  constructor(duration, insertedSprites, keptSprites, removedSprites) {
    this.duration = duration;
    this.insertedSprites = insertedSprites;
    this.keptSprites = keptSprites;
    this.removedSprites = removedSprites;
  }
  animate(motion) {
    if (motion.duration == null) {
      motion.duration = this.duration;
    }
    let self = this;
    return spawnChild(function *() {
      self.onMotionStart(motion.sprite);
      try {
        yield * motion._run();
      } finally {
        self.onMotionEnd(motion.sprite);
      }
    });
  }
  *_runToCompletion(transition) {
    yield * transition.call(this);
    yield childrenSettled();
  }
}
{'fraction_non_alphanumeric': 0.11316526610644258, 'fraction_numerical': 0.0016806722689075631, 'mean_word_length': 3.096330275229358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2982795', 'n_tokens_mistral': 586, 'n_tokens_neox': 552, 'n_words': 102}