20240517
This commit is contained in:
19
node_modules/store/plugins/observe.js
generated
vendored
Normal file
19
node_modules/store/plugins/observe.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
var eventsPlugin = require('./events')
|
||||
|
||||
module.exports = [eventsPlugin, observePlugin]
|
||||
|
||||
function observePlugin() {
|
||||
return {
|
||||
observe: observe,
|
||||
unobserve: unobserve
|
||||
}
|
||||
|
||||
function observe(_, key, callback) {
|
||||
var subId = this.watch(key, callback)
|
||||
callback(this.get(key))
|
||||
return subId
|
||||
}
|
||||
function unobserve(_, subId) {
|
||||
this.unwatch(subId)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user