svelte-webext-storage-adapter
svelte-webext-storage-adapter copied to clipboard
Feedback wanted: Getting notified about set starts/successes
Currently, consumers of this package have no way to be notified when one of its StorageArea.set() calls starts or succeeds, only when it fails (that's the onSetError option). This is sufficient for my use cases, as I make single-page-app WebExtensions that save small amounts of data at a time - but I'd love for my work to help as many people as it can. So, I'd like for the people who would be helped to tell me about their use cases and what changes they'd like to see.
The simplest thing to do would be to change the onSetError option to an onSet option that takes a Promise representing the set in progress. I could also return such a promise from a store's set/update call, but you can't get a return value from setting an $autoSubscription.
I see this got some upvotes. I've proposed an API as part of #14; check it out and make sure it works for your needs.
I'm closing this as it is now part of the v3 beta and is not at risk of removal. Leave your feedback for onWrite on #14.