⬆
v1 -> v2
New features and breaking changes
If you are only using the more commun features of
Evt
you can upgrade to v2 without facing any breaking change. Dropped backward compatibility with typescript 3.4.
EVT now requires a version of TypeScript >= 3.8 (February 20th, 2020)
- fλ Operators return type is
[U] | null (in v1: [U] | null | "DETACH" | {DETACH: Ctx} |...
StatefulEvt
: When attaching the handler should immediately be triggered with the state value. (except with attachExtract, and other *extract* methods)StatefulEvt
evt.state= x only triggers evt.post(x) if x !== evt.state- Support DOM observable like ResizeObserver like
Evt.from(ctx, ResizeObserver, htmlElement).attach(...)
Ctx
All handler added with a.done()
Ctx
should are immediately detached.- Get read of
VoidEvt
andVoidCtx
now that we can just useEvt<void>
andCtx<void>
- Easy way to test if an event data is handled by a particular operator
Evt.prototype.isHandledByOp()
(Evt.prototype.getStatelesOp()
replaced byEvt.prototype.getInvocableOp()
) evt/hooks/useStatefullEvt
renameduseRerenderOnStateChange
- Export
evt/tools/typeSafety
into a separate moduletsafe
Last modified 1yr ago