AppState
active in the foreground, background when another app or the home
screen is, inactive in between.
Verwendung
Refresh on return and release cached data
Dieser Typ wird verwendet von app.state
import { Button, app, watch } from 'kuito';
declare function refresh(): void;
const cache = new Map<string, ArrayBuffer>();
app.state.value; // 'active' | 'background' | 'inactive'
export function Feed() {
// Both follow the platform until the component unmounts.
watch(app.state, (state) => {
if (state === 'active') refresh();
});
app.watch('memoryWarning', () => cache.clear());
return <Button onPress={() => void app.openSettings()}>Open Settings</Button>;
}Typdeklaration
export type AppState = State;Typ
"active" | "background" | "inactive"Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.