mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Refactor out Cluster.apiUrl to direct reading
- Should help prevent using stale data - Removes some uses of synchronous FS operations Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
18d660ea77
commit
cd5ddd93c3
52 files changed
+437
-615
No files matched your search
@@ -85,6 +85,15 @@ export async function getOrInsertWithAsync<K, V>(map: Map<K, V>, key: K, asyncBu
|
||||
return map.get(key)!;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert `val` into `map` under `key` and then get the value back
|
||||
*/
|
||||
export function setAndInsert<K, V>(map: Map<K, V>, key: K, val: V): V {
|
||||
map.set(key, val);
|
||||
|
||||
return map.get(key)!;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value associated with `key` iff there was not a previous value
|
||||
* @param map The map to interact with
|
||||
|
||||
Reference in new issue
Block a user