Tom
Tom
SSolidJS
Created by Tom on 7/15/2024 in #support
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
SSolidJS
Created by Tom on 7/15/2024 in #support
Using createEffect to denormalise for efficiency - good/bad idea?
I stand corrected about the multiple selection - looks like that's possible using the second arg to createSelector
8 replies
SSolidJS
Created by Tom on 7/15/2024 in #support
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
SSolidJS
Created by Tom on 7/15/2024 in #support
Using createEffect to denormalise for efficiency - good/bad idea?
Perfect - thanks!
8 replies
SSolidJS
Created by phungleson on 9/11/2023 in #support
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
SSolidJS
Created by phungleson on 9/11/2023 in #support
Vitest 0.34.4 caused `You appear to have multiple instances of Solid`
Didn't help for me 😦
13 replies
SSolidJS
Created by phungleson on 9/11/2023 in #support
Vitest 0.34.4 caused `You appear to have multiple instances of Solid`
Any solutions to this? I'm running into the same issue vite 4.5.0 vite-plugin-solid" 2.7.2 vitest 0.34.6
13 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
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
SSolidJS
Created by Tom on 4/14/2023 in #support
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
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
But I guess map is a special case because we know each output element only depends on the corresponding input element, so it doesn't have the problem you just mentioned
27 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
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
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
I think you're right that looking at the implementation of mapArray is a good way to start
27 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
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
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
Creates a new data structure - just plain objects/arrays
27 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
That's super cool : ) Since my original data is already a store I don't think this fits my need. Or am I missing something?
27 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
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
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
I'll post what I end up with, if it seems at all generally interesting
27 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
@thetarnav in my case the original state is a Solid store. Will take a look at your link
27 replies
SSolidJS
Created by Tom on 4/14/2023 in #support
Efficient reactive rebuild of large derived object
@jc_m yeah I was aware that <For> has that behaviour, good to remember though - maybe this is part of the solution
27 replies
SSolidJS
Created by Tom on 2/7/2023 in #support
Router and createRoot
Awesome, thanks. I didn't know about that attribute. Was working without that before, I'm pretty sure 🤷‍♂️
4 replies