SolidJS, DXOS and reactivity
I am trying to port an app written in React and using DXOS (https://dxos.org). I am running into problems making the UI reactive. With React, the UI was reactive out of the box for any change from DXOS. With SolidJS, it seems like I have to wrap everything in a signal or createMemo to get the UI to react to changes. This adds up to dozens of signals needed to cover all of DXOS (database, authentication, presence etc.).
My setup below works for the higher level layers such as
client
, identity, and
spaces`, but anything inside those objects, there is no reactivity. I don't want to wrap everything in signals or stores. I already have local-first state with DXOS, why can I just consume it and have the UI react to changes?
https://gist.github.com/bradstedev/96a92966db7ed8702544c00959d9490dGist
SolidJS / DXOS reactivity issue
SolidJS / DXOS reactivity issue. GitHub Gist: instantly share code, notes, and snippets.
4 Replies
are you sure you need memo? I think it should be enough to just put it in a function and call it as is () => ...
what about something like
?
Thanks @bigmistqke for the code example. I tried it and it looks like a really good start so far. Reactivity is better with less code. Thanks
ur welcome!