https://github.com/haricharank9/pub-sub-topic-ts
Topic-based Publish-Subscribe pattern library TypeScript implementation.
https://github.com/haricharank9/pub-sub-topic-ts
design-pattern javascript publisher pubsub subscriber topic typescript typescript-library
Last synced: 6 months ago
JSON representation
Topic-based Publish-Subscribe pattern library TypeScript implementation.
- Host: GitHub
- URL: https://github.com/haricharank9/pub-sub-topic-ts
- Owner: haricharank9
- Created: 2021-12-19T19:38:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-19T20:53:25.000Z (almost 4 years ago)
- Last Synced: 2025-03-18T12:30:27.733Z (7 months ago)
- Topics: design-pattern, javascript, publisher, pubsub, subscriber, topic, typescript, typescript-library
- Language: TypeScript
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pub-sub-topic-ts
Topic based Publish-Subscribe pattern library TypeScript implementation.### Installation
```sh
npm install pub-sub-topic-ts
```### API
```typescript
// subscribe to a topic
subscribe(name: string, callback: (data: T[]) => void): Subscriber// publish to a topic
publish(topicName: string, data: T): void//unsubscribe from topic
unsubscribe(subscriber: Subscriber): void//delete a topic
deleteTopic(name: string): void//get list of topics
getTopics(): string[]
```