tinyplex / tinybase

The reactive data store for local‑first apps.

Home Page:https://tinybase.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object-based hooks should return same ref if unchanged

jamesgpearce opened this issue · comments

useTable, useRow, useValues etc will return a new object even if the content has not changed since the last render. Instead, they should be the same object (by reference) until the data changes.

h/t @cpojer

Fixed in https://github.com/tinyplex/tinybase/releases/tag/v5.0.1 with test case. @cpojer - please ensure this is what you meant.

See the commit. I am not now entirely sure why I went to all that effort to clone a fresh object each time, but the tests still pass!

Huge if true! I'll verify within the next week. Thank you 🙇‍♂️

Yes it's working! This is a great improvement, thank you 🙇‍♂️