tinyplex / tinybase

The reactive data store for local‑first apps.
https://tinybase.org
MIT License
3.23k stars 65 forks source link

useHas{row|table|cell|value} for react-ui #102

Closed marbemac closed 8 months ago

marbemac commented 8 months ago

Any chance for some hooks in ui-react that wrap the hasX methods and only fire change/re-render when the resulting boolean changes?

jamesgpearce commented 8 months ago

Definitely. I found myself needing this the other day too. 🙏

jamesgpearce commented 8 months ago

I started working on this in the 4.4 beta channel; did the underlying listeners first, with hooks to come next.

marbemac commented 8 months ago

❤️ awesome james, didn't expect such a quick turnaround, thank you!

jamesgpearce commented 8 months ago

Would have finished if I hadn't just spent 4 days sailing to Guyana, sorry

jamesgpearce commented 8 months ago

@marbemac, do you want to check out https://beta.tinybase.org/guides/releases/#v4-4 ? - it now contains the hooks (both for checking existence and for adding existence listeners). Please make sure it fulfills your requirements and works OK before I release :)

marbemac commented 8 months ago

Would have finished if I hadn't just spent 4 days sailing to Guyana, sorry

Well that sounds dope, I'm jealous :).

do you want to check out https://beta.tinybase.org/guides/releases/#v4-4 ? - it now contains the hooks (both for checking existence and for adding existence listeners). Please make sure it fulfills your requirements and works OK before I release :)

Sorry, I was at a conference for the past couple of days. Seems to work well, thank you again for tackling it!

jamesgpearce commented 8 months ago

Sorry I went ahead and launched anyway :) - so I hope the latest version works out!

jamesgpearce commented 8 months ago

Sorry I went ahead and launched anyway :) - so I hope the latest version works out!