Skip to content

Releases: zeixcom/ui-element

Version 0.4.0

30 Apr 23:05
d289890
Compare
Choose a tag to compare
Version 0.4.0 Pre-release
Pre-release

New Features

  • Consolidate API with Map-like interface (this.has(key), this.get(key), this.set(key, value) and this.delete(key)) and this.effect(fn); this being your custom element, usually called from within connectedCallback() in a class that extends UIElement
  • Use an signal objects internally that duck-type instances of Signal.State and Signal.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) and effect(fn) functions directly -> use the Map-like interface of UIElement
  • 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 to this.delete(key) explicitly before you can create a new derived / computed signal