activenotifier

package
v0.0.0-...-8e4f921 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL