openpanel/packages/cli/templates/provider/demo-live-provider.tsx
Stefan Pejcic 8595a9f4e5 back
2024-05-08 19:58:53 +02:00

32 lines
799 B
TypeScript

import { LiveProvider } from "@refinedev/core";
/**
* Check out the Live Provider documentation for detailed information
* https://refine.dev/docs/api-reference/core/providers/live-provider/
**/
export const liveProvider = (): LiveProvider => ({
subscribe: ({ callback, channel, types, params }) => {
console.log("subscribe", {
callback,
channel,
types,
params,
});
},
unsubscribe: ({ channel, types, params }) => {
console.log("unsubscribe", {
channel,
types,
params,
});
},
publish: ({ channel, type, date, payload }) => {
console.log("publish", {
channel,
type,
date,
payload,
});
},
});