Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 745 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 745 Bytes

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>