Auto-generate your
Query and mutation hooks to interact with your backend with
Advanced backend synchronization and UI state management patterns out-of-the box
Intuitive API over custom written code requiring minimal configuration
// generated RTK definitions
import {
selectTasks, selectTasksById,
selectTasksIds, useGetTasksQuery,
usePostTasksMutation, useDeleteTaskMutation
} from "./tasksData";
import {
selectColors, selectColorsById,
selectColorsIds, useGetColorsQuery,
} from "./colorsData";
// call the hooks
useGetColorsQuery()
useGetTasksQuery()
// inject data
const todo = useSelector(selectTasksById(id))
const allColors = useSelector(selectColors)
// initialize mutation hook
const [ addTask ] = usePostTasksMutation()
// this will issue a POST on /tasks endpoint
addTask({newTask: {text: "my new todo"}})
// initialize cache to manage local state
useCacheInit("status",
{ All: 'all', Active: 3, Completed: 1,});
// update cache
const onStatusChange = (status) => {
cacheUpdate("status", status)
}
We write the backend wiring code for your frontend. You get simple-to-use hooks,which implement advanced state management patterns to supercharge your frontend.
Try it out yourself: