Fix infinite render loop, fix repertoire entry removal

This commit is contained in:
2025-10-10 15:30:41 +02:00
parent 6ea21aa0f1
commit 4b1f7c260b
3 changed files with 4 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ interface CacheInterface<K, A, E> {
/**
* Retrieve the state currently stored in the cache for a given `key`.
*/
readonly getCurrent: (key: K) => Option.Option<State<A, E>>;
readonly getCurrent: (key: K) => State<A, E> | undefined;
/**
* Set or update the value currently stored in the cache for a given `key`
* and return the updated value. Running this effect while the state is
@@ -163,7 +163,7 @@ export const make = <K, A, E>(fetchFn: FetchFn<K, A, E>): Cache<K, A, E> => {
});
});
const getCurrent = (key: K) => Option.fromNullable(stateMap.get(key));
const getCurrent = (key: K) => stateMap.get(key);
const update = (key: K, action: Update<A>) => Effect.suspend(() => {
const state = stateMap.get(key);