Rename helper function to better communicate intent

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-03-31 15:17:50 -04:00
1 parent 6dd41c13ba
commit 67da7d7f5b
2 files changed
+3 -3

No files matched your search

@@ -8,7 +8,7 @@ import emitAppEventInjectable from "../../../../common/app-event-bus/emit-event.
import type { ClusterModel } from "../../../../common/cluster-types";
import { Cluster } from "../../../../common/cluster/cluster";
import clustersStateInjectable from "./state.injectable";
import { setAndInsert } from "@k8slens/utilities";
import { setAndGet } from "@k8slens/utilities";
export type AddCluster = (clusterModel: ClusterModel) => Cluster;
@@ -21,7 +21,7 @@ const addClusterInjectable = getInjectable({
return action((clusterModel) => {
emitAppEvent({ name: "cluster", action: "add" });
return setAndInsert(clustersState, clusterModel.id, new Cluster(clusterModel));
return setAndGet(clustersState, clusterModel.id, new Cluster(clusterModel));
});
},
});