@ifexcorp/core
v1.2.0
Published
A template npm library using typescript
Downloads
1
Readme
Using this package
- Install dependencies
// or npm install @ifexcorp/core @ifexcorp/message-broker
yarn add @ifexcorp/core @ifexcorp/message-broker
- Using the publisher
import { ILineCreatedEvent, CreatedLinePublisher, AbstractCreatedLineSubscriber } from '@ifexcorp/core'
const stan = null // get Nats connection
new CreatedLinePublisher(stan).publish('<EVENT NAME>', { ...data })
- Using the subscriber
import { ILineCreatedEvent, CreatedLinePublisher, AbstractCreatedLineSubscriber } from '@ifexcorp/core'
const stan = null // get Nats connection
async onMessage(data: ILineCreatedEvent): Promise<void> {
// processing received message
}
}
new CreatedLineSubscriber(stan).publish('<EVENT NAME>', { ...data })