You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find it weird that watch method doesn't actually provide me k:v pair for example.
Is there any specific reasoning why watcher strictly returns only event and key and can't be customized further?
Building a browser storage driver is not quite good this way. I'd expect in watcher to receive a key and value on update and only key on delete, for example.
With current implementation, I'd need to get the value from the storage, using the key it provides me with, which seem like overhead?
Additional information
Would you be willing to help implement this feature?
The text was updated successfully, but these errors were encountered:
Hello,
played arround with unstorage and it should take over and replace some of my features code parts out of the box!
Thanks for that awesome project 🥇 👍
watch could much more powerful with callback arguments changed to (key, value, oldValue, event) => {}.
value: Because value should be available during save data and trigger event a get overhead can be avoided?
oldValue: Would be cool for some use cases and helps to have more precise event type (added, updated or deleted) and more flexibility?
event filtering: Ok, just optional if easy to implement because it could be done by a wrapper arround the watch callback... filtering events by key match or regexp / wildcard based filter functions to listen to specific changes
I would love to see value and oldValue for my needs :)
Describe the feature
I find it weird that
watch
method doesn't actually provide mek:v
pair for example.Is there any specific reasoning why
watcher
strictly returns onlyevent
andkey
and can't be customized further?Building a browser storage driver is not quite good this way. I'd expect in watcher to receive a key and value on update and only key on delete, for example.
With current implementation, I'd need to
get
the value from the storage, using thekey
it provides me with, which seem like overhead?Additional information
The text was updated successfully, but these errors were encountered: