3 ms·
I looked around the Windows skin source but I guess I'm too dumb for it because this line makes no sense to me https://github.com/FoxMoss/dote-dreamland-win95-e
by throwaway290 11mo ago
I looked around the Windows skin source but I guess I'm too dumb for it because this line makes no sense to me https://github.com/FoxMoss/dote-dreamland-win95-example/blob/63aadc7a117501fd728411301b10101743417a86/src/main.tsx#L868 https://github.com/FoxMoss/dote-dreamland-win95-example/blob...
- yokljo 11mo agoI strongly suspect I know what that does because I worked with Svelte 4 for years (you no longer have to do this in Svelte 5. I can recommend Svelte 5, it's nice). Basically, assigning a state to itself tells it to signal that that state has changed and update anything that is listening to it. The `state` object is actually a JS Proxy returned by createState [0], which allows intercepting the assignment to the `windows` property and emit signals. Usually you dont have to do that, but in this case, the proxy doesn't notice that `state.windows.push(X)` is a mutation. Only assignments directly to the state object count as mutations. TLDR, `state.windows = state.windows` tells the framework that `windows` changed. [0]: https://github.com/MercuryWorkshop/dreamlandjs/blob/1e7a34a1d80eee8bc8df77bad9148cea70c825b8/src/core/state/state.ts#L43 https://github.com/MercuryWorkshop/dreamlandjs/blob/1e7a34a1...
- foxmoss 11mo agoI was drafting a reply when you sent this, this is the correct interpretation and why I did it.