@lokalise/events-common
v1.0.2
Published
This library abstracts common models for working with queues and topics.
Downloads
7,752
Maintainers
Keywords
Readme
Common events library
This library abstracts common models for working with queues and topics.
Getting Started
Install all dependencies:
npm install
Run all tests:
npm run test
Usage:
Use base event schema with you defined event payload. Example:
export type IMPORT_CONTENT_PAYLOAD_SCHEMA = z.object({
youField: z.string(),
})
export const IMPORT_CONTENT_SCHEMA = z.intersection(
BASE_EVENT_SCHEMA,
z.object({
payload: IMPORT_CONTENT_PAYLOAD_SCHEMA,
}),
)
In this example BASE_EVENT_SCHEMA
payload will be overridden by IMPORT_CONTENT_PAYLOAD_SCHEMA