svelte-webext-storage-adapter icon indicating copy to clipboard operation
svelte-webext-storage-adapter copied to clipboard

Feedback wanted: Getting notified about set starts/successes

Open PixievoltNo1 opened this issue 6 years ago • 1 comments

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.

PixievoltNo1 avatar Jun 03 '19 00:06 PixievoltNo1

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.

PixievoltNo1 avatar Oct 13 '22 01:10 PixievoltNo1

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.

PixievoltNo1 avatar Feb 05 '23 07:02 PixievoltNo1