Skip to content

Commit

Permalink
feat: add onNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed May 12, 2024
1 parent 68d9b8e commit af3af9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type SubHandler struct {
// Returns whether the subscription should be accepted.
VerifyChallenge func(h *esb.ResponseHeaders, chal *esb.SubscriptionChallenge) bool
OnRevocate func(h *esb.ResponseHeaders, revocation *esb.RevocationNotification)
OnNotification func(h *esb.ResponseHeaders)

// IDTracker used to deduplicate notifications
IDTracker IDTracker
Expand Down Expand Up @@ -292,6 +293,9 @@ func (s *SubHandler) handleNotification(
return
}
event := notification.Event
if s.OnNotification != nil {
s.OnNotification(h)
}

switch h.SubscriptionType {
case "channel.update":
Expand Down

0 comments on commit af3af9b

Please sign in to comment.