José Pablo Ramírez Vargas
José Pablo Ramírez Vargas
Look how simple things would be if Svelte gave the ability to set an effect up during component initialization: ```js // createStore.svelte.js export function createStore(initialValue, componentInitializing) { const store =...
```js // createStore.svelte.js export function createStore(initialValue, componentInitializing) { const store = $state({ value: initialValue }); if (componentInitializing || $effect.tracking()) { $effect(() => { console.log('Value: %o', store.value); }); } else {...
That would be awesome. Can't wait!
I know, hehe. It is dissimulated peer pressure. 😄 BTW, I was re-reading the docs on $effect.tracking. If this new API were to be equivalent to `insideComponentInit || $effect.tracking()`, would...
Maybe it is my ignorance, but I have only ever seen $effect.tracking being used to set effects up. Component initialization works for that too, so it is hard for me...
Hello, @paoloricciuti and thanks for dropping by with the definition Rich gave upon creation of the rune. As simple as it might be, I don't condone the practice of driving...
I understand all that. But doesn't that have a bug? What about this logic? 1. ComponentA reads `matches`. This installs the effect in the context of ComponentA. 2. ComponentB reads...
> and deregister the listener only if subscribers drop to 0 This is the part that is impossible to do unless you install one effect per read. How else can...
> It should work because on cleanup you also set matches to undefined retriggering the read from ComponentB and re-registering a new effect. Ok, for this **particular** case maybe it...
I need to create ambient modules: ```typescript declare module "@scope/utility-module" { ... } ``` These are modules exported by micro-frontends that are then consumed by other micro-frontends. All these are...