Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.
/ events Public archive

Lifecycle for your schemas at any scale.

License

Notifications You must be signed in to change notification settings

galatajs/events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Image

@galatajs/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 @galatajs/events provides it.

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

🔗 access on npm

Installation

npm install @galatajs/events

or with yarn

yarn add @galatajs/events

Example

Take a look at the example folder for example usage!

Basic Usage

import { createEvent } from "@galatajs/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.

About

Lifecycle for your schemas at any scale.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published