Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/starfx/react.ts

A micro-mvc framework for react apps
Go to Latest
import * as starfx from "https://deno.land/x/starfx@v0.13.2/react.ts";

Variables

A hook to access the redux dispatch function.

A hook to access the redux store's state. This hook takes a selector function as an argument. The selector is called with the store state.

Functions

useApi will take an action creator or action itself and fetch the associated loader and create a trigger function that you can call later in your react component.

useCache uses useQuery and automatically selects the cached data associated with the action creator or action provided.

useLoader will take an action creator or action itself and return the associated loader for it.

useLoaderSuccess will activate the callback provided when the loader transitions from some state to success.

useQuery uses useApi and automatically calls useApi().trigger()

Interfaces

This interface allows you to easily create a hook that is properly typed for your store's root state.