@istanbul/events
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published


@istanbul/events

Lifecycle for your schemas at any scale.

What Is It?

Server Side Event Package. Do you want to do something in customer service when there is a record in the product table? That's called lifecycle and @istanbul/events provides it.

You don't have to use istanbul framework, @istanbul/events is a nodejs package.

🔗 access on npm

Installation

npm install @istanbul/events

or with yarn

yarn add @istanbul/events

Example

Take a look at the example folder for example usage!

Basic Usage

import { createEvent } from "@istanbul/events";

let totalPrice = 0;

const callback = (price : number) : void => {
    totalPrice += price;
}

const onProductAddEvent = createEvent<number>("product-add");

onProductAddEvent.addListener(callback);
onProductAddEvent.publish(10);
onProductAddEvent.publish(20);

console.log(totalPrice); // 30

Although this explains the usage, the purpose of the package is more than that, please review the example folder for better usage.

Package Sidebar

Install

npm i @istanbul/events

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

11.5 kB

Total Files

19

Last publish

Collaborators

  • ssi-istanbul