event-bus
/
3.1.0
event-bus 3.1.0
Install from the command line:
Learn more about npm packages
$ npm install @nextcloud/event-bus@3.1.0
Install via package.json:
"@nextcloud/event-bus": "3.1.0"
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