usePublish
If you need to publish a custom events refine provides the usePublish
hook for it, It returns the publish
method from liveProvider
under the hood.
Usage
警告
This hook can only be used if liveProvider
's publish
method is provided.
import { usePublish } from "@pankod/refine-core";
const publish = usePublish();
publish({
channel: "custom-channel-name",
type: "custom-event-name",
payload: {
"custom-property": "custom-property-value",
},
date: new Date(),
});
信息
You can subscribe to event with useSubscription
.