You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the JSDoc for useLoaderSuccess suggests using the loader from useApi, but useApi does not return the full loader object, which causes confusion when trying to use useLoaderSuccess with useApi.
There seem to be two possible approaches to resolve this:
Export the full loader object so it can be used seamlessly with useLoaderSuccess. This would look like:
return{ ...loader, loader, trigger, action };
Update the JSDoc for useLoaderSuccess. For example:
/***useLoaderSuccess* ....*constView=()=>{*const{trigger}=useApi(createUser);*constloader=useLoader(createUser);// Use useLoader to get the full loader*constonSubmit=()=>{*trigger({name: 'bob'});*};*```
I think this issue should be addressed in some manner to avoid confusion.
The text was updated successfully, but these errors were encountered:
Currently, the JSDoc for
useLoaderSuccess
suggests using theloader
fromuseApi
, butuseApi
does not return the fullloader
object, which causes confusion when trying to useuseLoaderSuccess
withuseApi
.return { ...loader, trigger, action };
vs.
const { loader, trigger } = useApi(createUser);
There seem to be two possible approaches to resolve this:
I think this issue should be addressed in some manner to avoid confusion.
The text was updated successfully, but these errors were encountered: