event-bus
/
3.0.2
event-bus 3.0.2
Install from the command line:
Learn more about npm packages
$ npm install @nextcloud/event-bus@3.0.2
Install via package.json:
"@nextcloud/event-bus": "3.0.2"
About this version
A simple event bus to communicate between Nextcloud components.
npm install @nextcloud/event-bus --save
yarn add @nextcloud/event-bus
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
const h = e => console.info(e)
subscribe('a', h)
subscribe('b', h)
emit('a', {
data: 123,
})
unsubscribe('a', h)
unsubscribe('b', h)
To stay consistent, we encourage you to use the following syntax when declaring events
app-id:object:verb
nextcloud:unified-search:closed
files:file:uploading
files:file:uploaded
contacts:contact:deleted
calendar:event:created
forms:answer:updated
npm install
npm run build
npm run test