editor.js/docs/events.md
George Berezhnoy 69a5c21bb6
Rename to Editor.js (#625)
* Rename to Editor.js in package, comments and docs

* More changes

* Done with renaming in code, docs, and comments

* Revert renaming of tools org

* Update submodules

* Changes due comments

* Fix double slash

* editorjs -> @editorjs/editorjs

* Update package.json

Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com>

* Update webpack.config.js

Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com>

* Update bundle
2019-02-28 14:01:32 +03:00

978 B

Editor.js Events Module

Module allows Developers to subscribe on events or trigger own events

Methods

On

Events.on(eventName, callback)

Method subscribes callback on event. It will be called when Editor.js emits this event

params

Param Type Description
eventName String event name
callback Function event callback

Off

Events.off(eventName, callback)

Method unsubscribes callback on event

params

Param Type Description
eventName String event name
callback Function event callback

Emit

Events.emit(eventName, data)

Method emits data to all subscribed callbacks

params

Param Type Description
eventName String event name
data Object any data