Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveNotifier ¶
type ActiveNotifier struct {
// contains filtered or unexported fields
}
func New ¶
func New(initialState bool) *ActiveNotifier
func (*ActiveNotifier) AddHandler ¶
func (n *ActiveNotifier) AddHandler(f func(bool))
AddHandler adds a handler. It will be called on any update, including immediately with the current state
func (*ActiveNotifier) CurrentlyActive ¶
func (n *ActiveNotifier) CurrentlyActive() bool
CurrentlyActive returns whether the state is currently active.
func (*ActiveNotifier) StoreAndNotify ¶
func (n *ActiveNotifier) StoreAndNotify(b bool)
StoreAndNotify stores the current state and notifies all handlers
Click to show internal directories.
Click to hide internal directories.