Optional add?: DataManagerId[]Data managers to subscribe to
Optional remove?: DataManagerId[]Data managers to unsubscribe from
// Subscribing to data managers
const subscription: DataManagerSubscription = {
add: [
{ id: "gameState" },
{ id: `player_${userId}` }
]
};
// Unsubscribing from data managers
const unsubscription: DataManagerSubscription = {
remove: [{ id: "temporaryEvent" }]
};
Used to subscribe or unsubscribe to data manager changes.
When a client connects, it subscribes to data managers it wants to sync with. The server then sends initial data and keeps the client updated with changes.