WebReflection / signal

An extremely basic signals implementation.
https://calendar.perfplanet.com/2022/signals-the-nitty-gritty/
ISC License
61 stars 3 forks source link

Make untracked return value & effect handle teardown #6

Closed dy closed 8 months ago

dy commented 8 months ago

Hi @WebReflection

I know you mentioned there's no fancy features in this library, but I took liberty to propose 2 updates.

  1. untracked function seemingly must return a value - I missed that out making #5
  2. effect callback can return a teardown (like useEffect) - not directly documented in preact, but very handy feature, low-hanging fruit. It's minor breakage of existing API, but in favor of more standardization.

Please let me know if you find value in these changes.

coveralls commented 8 months ago

Pull Request Test Coverage Report for Build 8069503242

Details


Totals Coverage Status
Change from base Build 8050013448: 0.0%
Covered Lines: 149
Relevant Lines: 149

💛 - Coveralls
WebReflection commented 8 months ago

done?

dy commented 8 months ago

Yep, looks perfect, thanks @WebReflection