@standard-library/kefir-evolve

Given an object containing Kefir streams as values, emits new objects with the stream events under the corresponding key.


License
MIT
Install
npm install @standard-library/kefir-evolve@1.2.0

Documentation

kefir-evolve

Given an object containing Kefir streams as values, emits new objects with the stream events under the corresponding key.

Installation

npm install @standard-library/kefir-evolve

Usage

import evolve from "kefir-evolve";

const initial = { height: 0 };
const styles = evolve({
  color: Kefir.sequentially(1000, ["red", "green", "blue"]),
  height: Kefir.sequentially(500, [10, 50, 100])
}, initial);

// [evolve] <value> { height: 0 }
// [evolve] <value> { height: 10 }
// [evolve] <value> { height: 50, color: "red" }
// [evolve] <value> { height: 100, color: "red" }
// [evolve] <value> { height: 100, color: "green" }
// [evolve] <value> { height: 100, color: "blue" }
// [evolve] <end>