Releases: zeixcom/ui-element
Releases · zeixcom/ui-element
Version 0.4.0
New Features
- Consolidate API with
Map
-like interface (this.has(key)
,this.get(key)
,this.set(key, value)
andthis.delete(key)
) andthis.effect(fn)
;this
being your custom element, usually called from withinconnectedCallback()
in a class that extendsUIElement
- Use an signal objects internally that duck-type instances of
Signal.State
andSignal.Computed
of the early stage TC39 Signals Proposal, see https://github.com/tc39/proposal-signals - Add types.d.ts definition
- Add more tests
Breaking Changes from v0.3.0
- No longer expose
cause(value)
andeffect(fn)
functions directly -> use theMap
-like interface ofUIElement
- Remove ability to return a cleanup function from effect callback functions -> just add cleanup code at the end of effect callback function
- Functions passed to
this.set(key, fn)
will be treated as derived or computed signals and are read-only -> if you want to replace the function using the same key, you have tothis.delete(key)
explicitly before you can create a new derived / computed signal