when(key: KeyLike<Key>, value: ValueLike<Val>): When<Key, Val> {
    return new When<Key, Val>(this.config, this.rootKey, [
      ...this.states,
      { key, value },
    ]);