Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/trutoo/event-bus into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Hughes committed Mar 11, 2021
2 parents b417e41 + 037c0dc commit 38e5dff
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ register(channel: string, schema: object): boolean;

**Returns** - returns true if event channel already existed of false if a new one was created.

---

### Unregister

Unregister the schema for the specified event type if channel exists.
Expand All @@ -268,6 +270,8 @@ unregister(channel: string): boolean;

**Returns** - returns true if event channel existed and an existing schema was removed.

---

### Subscribe

Subscribe to an event channel triggering callback on received event matching type,
Expand Down Expand Up @@ -298,6 +302,8 @@ Callbacks will be fired when event is published on a subscribed channel with the

**Returns** - object containing an unsubscribe method

---

### Publish

Publish to event channel with an optional payload triggering all subscription callbacks.
Expand All @@ -315,6 +321,8 @@ publish<T>(channel: string, payload?: T): void;

**Returns** - void

---

### Get Latest

Get the latest published payload on the specified event channel.
Expand All @@ -331,6 +339,8 @@ getLatest<T>(channel: string): T | undefined;

**Returns** - the latest payload or `undefined`

---

### Get Schema

Get the schema registered on the specified event channel.
Expand Down

0 comments on commit 38e5dff

Please sign in to comment.