appstate

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package appstate says when the app goes to the background or comes back: to pause something, or refresh what's on screen.

nimbus native plugin add app-state

go appstate.Watch(ctx, func(active bool) {
	if active {
		refresh()
	}
})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active(ctx context.Context) (bool, error)

Active reports whether the app is in front.

func Watch

func Watch(ctx context.Context, f func(active bool)) error

Watch calls f when the app comes to the front or leaves it, until ctx ends. It blocks, so run it from a goroutine in an effect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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