Tom
Using createEffect to denormalise for efficiency - good/bad idea?
Looks like createSelector internals are a bit beyond my understanding, relying on internal things that are not in the docs. I'm going to press ahead see if createSelector will work for my use-case, and avoid the pattern I posted above for now. Maybe it won't be needed.
8 replies
Using createEffect to denormalise for efficiency - good/bad idea?
Hmm this seems quite limited to a very specific use-case. My question is about the broader concept of using createEffect to denormalise, for efficiency reasons. For example, createSelector looks like it can't support multiple selections. I'll have a look at the source for createSelector to learn how best to do things like this.
8 replies
Vitest 0.34.4 caused `You appear to have multiple instances of Solid`
No solution here, but it doesn’t seem to be actually causing any problem. I’d just rather have the peace of mind of not seeing that message. For now I’m just ignoring it.
13 replies
Efficient reactive rebuild of large derived object
@jc_m I remember I said I'd follow up - it turned out for me the best place to do this was application specific. There's a place in my code that every store change is routed through, and I have more information e.g. object added/deleted/changed. Solid's reactivity only tracks "something changed" so this info is lost.
27 replies
Efficient reactive rebuild of large derived object
Yeah that's exactly what I'm thinking. Am looking at mapArray now and I see it has to do full scans of the array to figure out what happened.
At least it would be cool to be able to listen for keys added/removed to objects. That can be implemented in a similar way to mapArray I guess, but I wonder if there's a more efficient way more deeply integrated.
27 replies
Efficient reactive rebuild of large derived object
The part that seems relevant is that it takes a computation - the map function - that would happen array.length times for every source change, if we used a simple createMemo + Array.map - and only calls it for newly added elements.
27 replies
Efficient reactive rebuild of large derived object
What I'd like to do is update the derived data in a minimal way when the store changes. I think createImmutable is more useful for reacting to changes in the derived data, not building the derived data in the first place?
27 replies
Efficient reactive rebuild of large derived object
@thetarnav from your createImmutable: "The source can be any signal that is updated in an immutable fashion."
I'm not 100% sure what that means - is it a signal where all the values over time are themselves immutable?
27 replies