4 ms·
That's pretty awesome news regarding your conversations. I hadn't even thought of the `reducers` slice property. I meant more all the thunky features around th
by komali2 3y ago
That's pretty awesome news regarding your conversations.
I hadn't even thought of the `reducers` slice property. I meant more all the thunky features around the `endpoints` property and the hooks that are autogenerated as a result. In our components this meant we could have for example a form that takes an api model as input and can modify that model on submit. So like,
...component boilerplate
const {
data,
isLoading,
isFetching,
isError,
isSuccess,
} = useGetSomeDataQuery();
const [updateData, {
isLoading,
isUninitialized,
isSuccess,
isError
}] = useSomeDataMutation();
And then right there is all the state we really need to worry about for a given form as we interact with the API. Though again the missing bits are the stuff managed by Formik, like changed but unsubmitted inputs and etc, but those definitions would also be up top near the RTK stuff and so at least while editing it's visually available. Like you said doesn't necessarily pass muster as an actual state machine unless you have lots of checks in your useEffects or wherever else you're reacting to state changes about the entire state of the component.