github refinedev/refine @refinedev/core@4.44.5

Patch Changes

  • #5087 88d52d639b9 Thanks @alicanerdurmaz! - feat: meta props added liveProvider.subscribe and liveProvider.publish methods.
    From now on, you can use meta to distinguish between methods by meta.

    meta type:

    import { QueryFunctionContext } from "@tanstack/react-query";
    
    type Fields = Array<string | object | NestedField>;
    
    type VariableOptions =
        | {
              type?: string;
              name?: string;
              value: any;
              list?: boolean;
              required?: boolean;
          }
        | { [k: string]: any };
    
    type Meta = {
        dataProviderName?: string;
        operation?: string;
        fields?: Fields;
        variables?: VariableOptions;
        queryContext?: QueryFunctionContext;
        [k: string]: any;
    };

    Usage

    import { LiveProvider, LiveEvent } from "@refinedev/core";
    
    export const liveProvider = (client: any): LiveProvider => {
        return {
            subscribe: ({ channel, types, params, callback, meta }) => {
                console.log({ meta });
            },
    
            publish: ({ channel, type, payload, date, meta }: LiveEvent) => {
                console.log({ meta });
            },
        };
    };

Don't miss a new refine release

NewReleases is sending notifications on new releases.