Skip to content
event-bus / 3.0.0

event-bus 3.0.0

Install from the command line:
Learn more about npm packages
$ npm install @nextcloud/event-bus@3.0.0
Install via package.json:
"@nextcloud/event-bus": "3.0.0"

About this version

@nextcloud/event-bus

Build Status npm Documentation

A simple event bus to communicate between Nextcloud components.

Installation

npm install @nextcloud/event-bus --save
yarn add @nextcloud/event-bus

Usage

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)

Naming convention

To stay consistent, we encourage you to use the following syntax when declaring events

app-id:object:verb

Examples:

  • nextcloud:unified-search:closed
  • files:file:uploading
  • files:file:uploaded
  • contacts:contact:deleted
  • calendar:event:created
  • forms:answer:updated

Development

npm install

npm run build
npm run test

Requirements

Details


Assets

  • event-bus-3.0.0-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all