new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Redux Toolkit · all subjects

rtk query/overview

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

RTK Query is an optional addon for data fetching and caching

RTK Query is provided as an optional addon within the @reduxjs/toolkit package. It is purpose-built to solve the use case of data fetching and caching, supplying a compact, but powerful toolset to define an API interface layer for your app.

RTK Query entry points

RTK Query is available via two entry points: import { createApi } from '@reduxjs/toolkit/query' for general use, and import { createApi } from '@reduxjs/toolkit/query/react' for the React-specific entry point that automatically generates hooks corresponding to the defined endpoints.

createApi is the core of RTK Query

createApi() is the core of RTK Query's functionality. It allows you to define a set of endpoints and describe how to retrieve data from a series of endpoints, including configuration of how to fetch and transform that data. In most cases, you should use this once per app, with one API slice per base URL as a rule of thumb.

fetchBaseQuery is a recommended wrapper around fetch

fetchBaseQuery() is a small wrapper around fetch that aims to simplify requests. It is intended as the recommended baseQuery to be used in createApi for the majority of users.

ApiProvider can be used without a Redux store

ApiProvider can be used as a Provider if you do not already have a Redux store.

setupListeners enables refetchOnMount and refetchOnReconnect

setupListeners() is a utility used to enable refetchOnMount and refetchOnReconnect behaviors.

Give your agent this brain