Skip to content

Commit

Permalink
notifier: Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
c032 committed Feb 10, 2024
1 parent e7edc2f commit a0de329
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion notifier.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package dsts

// Notifier can run callbacks when there's a new update on some data, so that
// the i3 status line can be redrawn.
type Notifier interface {
// OnUpdate registers `callback` to be called when there's an update.
//
// It returns a function that, when called, should un-register `callback`
// so that it's no longer called on updates.
OnUpdate(callback OnUpdateCallbackFunc) RemoveOnUpdateCallbackFunc
}

type OnUpdateCallbackFunc func()

type RemoveOnUpdateCallbackFunc func()

type NotifierFunc func(callback OnUpdateCallbackFunc) RemoveOnUpdateCallbackFunc
Expand Down

0 comments on commit a0de329

Please sign in to comment.