23 lines
337 B
TypeScript
23 lines
337 B
TypeScript
import notify from "./notify"
|
|
import watch from "./watch"
|
|
|
|
export default function register({
|
|
type,
|
|
data,
|
|
recipientSubscriptionJSON,
|
|
}: {
|
|
type: string
|
|
data: any
|
|
recipientSubscriptionJSON: any
|
|
}) {
|
|
function onNotify() {
|
|
notify(recipientSubscriptionJSON)
|
|
}
|
|
|
|
watch({
|
|
type,
|
|
data,
|
|
callback: onNotify,
|
|
})
|
|
}
|