mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Refactor to use subsribers
This commit is contained in:
16 files changed
+120
-707
No files matched your search
@@ -29,9 +29,9 @@ export function useSaves(instanceId?: number): lib.SaveDetails[] {
|
||||
setSaves(data.saves);
|
||||
}
|
||||
|
||||
control.onSaveListUpdate(instanceId!, updateHandler);
|
||||
control.saveListUpdate.subscribeToChannel(instanceId!, updateHandler);
|
||||
return () => {
|
||||
control.offSaveListUpdate(instanceId!, updateHandler);
|
||||
control.saveListUpdate.unsubscribeFromChannel(instanceId!, updateHandler);
|
||||
};
|
||||
}, [instanceId]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user