Skip to content

feat(storage): allow record in watch callback - #342

Closed
nnx0r wants to merge 2 commits into
unjs:mainfrom
nnx0r:main
Closed

nnx0r wants to merge 2 commits into
unjs:mainfrom
nnx0r:main

Conversation

@nnx0r

@nnx0r nnx0r commented Nov 16, 2023

Copy link
Copy Markdown

🔗 Linked issue

#341

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

It provides flexibility in what the watch callback can return, when changes are detected.
Sometimes it can be highly useful to get both the key and the value of the property that was changed. I guess sometimes it can be used for some additional properties too.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

I did not find in the docs any mentions of what callback must be defined as.

@pi0

pi0 commented May 1, 2024 •

Copy link
Copy Markdown
Member

Hi. I appreciate your work on this PR mostly non of storage driver watchers get the value on watch event nor this PR adds support for any driver.

We can do it by introducing a third optional value?: unknown parameter to the callback AND consider which drivers already have it in their watch event (I guess currently only web-based drivers)

Closing PR but feel free to open a new with above proposal.

@pi0 pi0 closed this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants