Options
All
  • Public
  • Public/Protected
  • All
Menu

@nextcloud/event-bus

@nextcloud/event-bus

Build Status npm Documentation

A simple event bus to communicate between Nextcloud components.

Installation

npm i -S @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)

Generated using TypeDoc