1.0.11 • Published 9 months ago

@asaje/sse-push-event-server v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

SSE-PUSH-EVENT

Description

Lightweight package for SSE push events handling

Installation

npm i @asaje/sse-push-event-server

or

yarn add @asaje/sse-push-event-server

How to use

// Example of NestJS controller
@Sse('events')
connectSse(@Res() res: Response) {
  const { value, destroy } = initPushEventSubscription();
  res.on('close', () => {
    destroy();
  });

  return value;
}


// Sending event
sendPushEvent({
  event: 'TEST',
  data: { msg: 'Hello' },
  room: 'test-room',
})
1.0.11

9 months ago

1.0.10

9 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago