Skip to Content
Effetch Query
Reference

@monarcode/effetch-query/react-native

Every export of the React Native entry point: focus and online signals from React Native's modules.

@monarcode/effetch-query/react-native builds a client's signals from React Native's own modules, which you pass in. Import what you use:

import {  } from "@monarcode/effetch-query/react-native";

Its exports follow, grouped by the guide that covers them, each with its docs. Your editor shows the same docs, with an example, when you hover the name.

React Native

Guide: React Native.

reactNativeSignals

Makes signals for React Native: focus is the app coming back to the foreground (AppState changing to "active" from anything else), and online follows NetInfo's isConnected, where null (not known yet) counts as online. Pass them as the signals option of QueryClient.make, in place of the default Signals.browser, which never changes without a DOM. The parameters are AppStateLike and NetInfoLike.

Each client starts its own listeners when one of its queries first needs them, and stops them once no cached query does or the client is disposed, so one set of signals can serve several clients.

AppStateLike

The part of React Native's AppState that reactNativeSignals uses. AppState from react-native satisfies it, so this package never imports react-native.

Prop

Type

NetInfoLike

The part of NetInfo (@react-native-community/netinfo) that reactNativeSignals uses. Its default export satisfies it, so this package never imports it.

Prop

Type

ReactNativeSignalsOptions

What reactNativeSignals listens to.

Prop

Type

On this page