Usage

Refresh on return and release cached data

This type is used by app.state

tsx
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>;
}

Type declaration

ts
export type AppState = State;

Type

ts
"active" | "background" | "inactive"
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.