halu
Explore posts from serversSOLVED: Non-Reactive Memo for Reactive Values?
the neat thing is you can turn this into a lazyMemo (in the more traditional sense) by making is_dirty a signal
https://playground.solidjs.com/anonymous/9180d89f-9645-41b0-be79-a4c9a649b852
https://playground.solidjs.com/anonymous/0890796b-142f-4a88-b3be-2c4521ec4552 (had to pin deps)
comparison to OG lazyMemo:
https://playground.solidjs.com/anonymous/f3e5d31e-56a0-463c-8754-914c6c3515c4
https://playground.solidjs.com/anonymous/16c504f7-3ffa-4532-b071-176bee23d9b9 ( had to pin deps )
13 replies
SOLVED: Non-Reactive Memo for Reactive Values?
turns out lazyMemo primitive wasn't working in my production use-case...
This is what i had to do to eliminate the watcher/on() pattern:
https://playground.solidjs.com/anonymous/8dc85006-f489-46b1-887a-18d1f9c7812f
(did this mostly for fun, not sure I'd actually use it)
13 replies
SOLVED: Non-Reactive Memo for Reactive Values?
i misunderstood defer, doesn't really help here...
found that lazyMemo doesn't really work with untrack
https://playground.solidjs.com/anonymous/a7e1c35c-7687-44f7-bfa3-8530bed6a914
however, untrack is no longer be necessary given how it works (at least for my use-case)
https://playground.solidjs.com/anonymous/89072d00-f796-441b-ac99-4415d22f095e
https://playground.solidjs.com/anonymous/6851a2d5-d67f-42a3-894a-693c95838b1d
couldn't get a track/trigger version to work as trigger is always dirty, thus the memo always computes regardless of whether signals in it callback are clean/unchanged:
thx for the help guys!
13 replies
DOMException *sometimes* after changing element order
perhaps try <Index />?
https://playground.solidjs.com/anonymous/52baeeaf-4d81-4e51-a681-52378d1cf275
4 replies
DeepTrack for a `Component[]` (Deeptrack for functions)
Reconcile on array works too:
https://playground.solidjs.com/anonymous/15b6ea3c-a814-4e14-9b16-e9456732e351
11 replies
DeepTrack for a `Component[]` (Deeptrack for functions)
are you trying to use a function as an object?
idk why else you'd want deep reactivity on a raw function
wrapped in an array it works as expected i believe?
https://playground.solidjs.com/anonymous/3917c01c-1670-4e53-9341-e10ebbc79540
https://playground.solidjs.com/anonymous/ccf6e719-b81a-46fa-8255-e980be841dbb
otherwise, shallow:
https://playground.solidjs.com/anonymous/4a71a4ac-f5c4-4388-b057-6e0dbfc49242
11 replies
SOLVED: Trigger Side Effects on a Callbacks Dependency Updates
Sorry to revive,
just cross-linking an update in case anyone should find themselves here in the future
https://discord.com/channels/722131463138705510/1252318635989405818
181 replies
SOLVED: Trigger Side Effects on a Callbacks Dependency Updates
^
there are million tradeoffs... look up times, mutation costs, book keeping and denormalizing data, memory footprint, data volatility, shape of data and updates (may not have control), DX, etc. really just depends on the situation and requirements what is best.
181 replies