@narando/event-types
Helps handle narando events type safe.
Related packages are @narando/event-consumer
and @narando/event-producer
.
Getting Started
You need to have nodejs
and npm
installed.
$ npm install @narando/event-types
Usage
import {
NarandoEvent,
ArticleCreatedSoundFileEvent,
isArticleCreatedSoundFileEvent,
} from "@narando/event-types";
function handleEvent(event: NarandoEvent) {
if (isArticleCreatedSoundFileEvent(event)) {
event.msg.target.soundFileId;
}
}
function handleArticleCreatedSoundFileEvent(
event: ArticleCreatedSoundFileEvent
) {}
Development
As this package is part of the toolkit monorepo, please refer to the top-level
README to learn about hacking on this package.