Multiple liveProvider

Hello, I can't find the information is it possible to have multiple liveProvider, for instance, we can have many dataProvider, but is it possible with liveProvider ? I want something similar to my dataProvider list:
export enum PROVIDERS {
EXERCISES="service_exercises",
RESULTS="service_results",
LEARNING_LAB="learning_lab"
}

export const refineConfig: RefineProps = {
dataProvider: {
default: dataProvider("http://localhost:3000"),
[PROVIDERS.EXERCISES]: dataProvider("http://localhost:3000"),
[PROVIDERS.RESULTS]: dataProvider("http://localhost:3001"),
[PROVIDERS.LEARNING_LAB]: dataProvider("***")
},
notificationProvider: notificationProvider,
routerProvider: routerBindings,
liveProvider: liveProvider("***"),
resources: routesConfig,
options: {
syncWithLocation: true,
warnWhenUnsavedChanges: true,
}
}

export default refineConfig;
export enum PROVIDERS {
EXERCISES="service_exercises",
RESULTS="service_results",
LEARNING_LAB="learning_lab"
}

export const refineConfig: RefineProps = {
dataProvider: {
default: dataProvider("http://localhost:3000"),
[PROVIDERS.EXERCISES]: dataProvider("http://localhost:3000"),
[PROVIDERS.RESULTS]: dataProvider("http://localhost:3001"),
[PROVIDERS.LEARNING_LAB]: dataProvider("***")
},
notificationProvider: notificationProvider,
routerProvider: routerBindings,
liveProvider: liveProvider("***"),
resources: routesConfig,
options: {
syncWithLocation: true,
warnWhenUnsavedChanges: true,
}
}

export default refineConfig;
Thanks in advance !
5 Replies
kapa.ai
kapa.ai12mo ago
Hi @realdragonma. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai12mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. The information extracts provided do not mention the possibility of using multiple liveProviders in a refine application. However, you can refer to the liveProvider documentation (https://refine.dev/docs/api-reference/core/providers/live-provider) for more information on how to use liveProviders in refine. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai12mo ago
<@214840332943097856> kapa.ai is still learning and improving, please let us how it did by reacting below
optimistic-gold
optimistic-gold12mo ago
Hello @realdragonma, You don't need to define multiple liveProvider. It doesn't support it anyway. When you call any data hook, the hook will send a payload(like resource, meta, id, action, dataProviderName etc.) to the liveProvider's subscribe method. So, you can handle your subscriptions in the subscribe method by checking the payload.
fascinating-indigo
fascinating-indigo12mo ago
Oh I see, thank you !