Implement workaround for infinite recursion with the chrome storage change listener#65
Implement workaround for infinite recursion with the chrome storage change listener#65ckiee wants to merge 1 commit intoMacFJA:mainfrom
Conversation
…hange listener Fixes MacFJA#64, albeit in a rather fragile manner. Ideally we'd be able to pass another argument through the Svelte store API or have the concept of a thread local variable but we have neither as things are dispatched over multiple JS ticks
|
Converting to draft as it doesn't work if you make multiple updates in a tick |
|
I think it would be better to add a control to prevent saving the same data again and again. It can be done on the storage itself or in the But we have to watch for the performance, I fear that reading the storage every time can be a bit costly. (and we need to read the storage not the store, because the storage can be changed outside the application) |
|
I ended up abandoning the current patch because if you have this setup it loops when there is more than one edit per tick:
I realized all I need is one way updates so I use the extension messaging now from the options page to the background script, this could be added to this library too by making the argument type |
Fixes #64, albeit in a rather fragile manner. Ideally we'd be able to pass another argument through the Svelte store API
or have the concept of a thread local variable but we have neither as things are dispatched over multiple JS ticks