garronej / evt

💧EventEmitter's typesafe replacement
https://evt.land
MIT License
454 stars 6 forks source link

V2 🚀 #16

Closed garronej closed 2 years ago

garronej commented 3 years ago

Install 2.0 beta now:

npm install --save evt@beta yarn add evt@beta

If you wish to use v2 beta on Deno, don't hesitate to ping me I will publish it somehow.

Roadmap:

Trade offs:

Dropped backward compatibility with typescript 3.4.
EVT now requires a version of TypeScript >= 3.8 (February 20th, 2020)

garronej commented 2 years ago
import { Evt } from "evt";

const obj = { "foo": 33 };

const evt = Evt.create(obj);

evt.attach(o=> console.log("1", o.foo));

evt.pipe(o => [o.foo]).attach(foo=> console.log("2", foo));

//evt.state = { "foo": 33};

//evt.postForceChange([obj]);

//evt.state = obj;

evt.post(obj);
garronej commented 2 years ago

image

Fix Evt.factorize when there is undefined in the union