feat(core): add ability to call custom methods from data providers
Example Usage
const { mutate } = useCustomMethod("myCustomMethod", { as: "mutation" });
const { data, isLoading } = useCustomMethod("myCustomMethod", { as: "query" });
const { data, isLoading } = useCustomMethod("myCustomMethod");
Example Implementation
import simpleRestDataProvider from "@refinedev/simple-rest";
const dataProvider = {
...simpleRestDataProvider("https://my.api.com"),
customMethods: {
myCustomMethod: ({ params, meta }) => ({
data: {},
}),
},
};
Self Check before Merge
Please check all items below before review.
- [ ] Corresponding issues are created/updated or not needed
- [ ] Docs are updated/provided or not needed
- [ ] Examples are updated/provided or not needed
- [ ] TypeScript definitions are updated/provided or not needed
- [ ] Tests are updated/provided or not needed
- [ ] Changesets are provided or not needed
🦋 Changeset detected
Latest commit: 5e57b5317fc3833d9956df69048ac53546a3711d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
☁️ Nx Cloud Report
We didn't find any information for the current pull request with the commit 5e57b5317fc3833d9956df69048ac53546a3711d. Please verify you are running the latest version of the NxCloud runner.
Check the Nx Cloud Source Control Integration documentation for more information.
Alternatively, you can contact us at [email protected].
Sent with 💌 from NxCloud.
We'll clarify the details more later.