Patch Changes
-
#5050
613af0021f6
Thanks @alicanerdurmaz! - feat: passdataProviderName
toliveProvider.subscribe
method.
From now on, you can usedataProviderName
to distinguish between different data providers in live provider.Refer to documentation for more info about multiple data providers ->
Usage
import { useForm, useList } from "@refinedev/core"; useList({ dataProviderName: "first-data-provider", }); useForm({ dataProviderName: "second-data-provider", });
import { LiveProvider } from "@refinedev/core"; export const liveProvider = (client: any): LiveProvider => { return { subscribe: ({ channel, types, params, callback, dataProviderName, }) => { console.log({ dataProviderName }); // "second-data-provider" }, }; };
-
#5053
857d4020a30
Thanks @alicanerdurmaz! - feat: The parameter types of data provider methods have been exported.
From now on, you can use the parameter types of Data Provider methods.import type { DataProvider, GetListResponse // new exported types GetListParams, GetManyParams, GetOneParams, CreateParams, CreateManyParams, UpdateParams, UpdateManyParams, DeleteOneParams, DeleteManyParams, CustomParams, } from "@refinedev/core"; const myDataProvider: DataProvider = { getList: async (params: GetListParams): Promise<GetListResponse<any>> => { return { data: [], total: 0 }; }, };