Skip to content

Instantly share code, notes, and snippets.

@ccapndave
Created August 26, 2020 18:08
Show Gist options
  • Save ccapndave/5c3d02f0da951b6cb4892217ee5dc151 to your computer and use it in GitHub Desktop.
Save ccapndave/5c3d02f0da951b6cb4892217ee5dc151 to your computer and use it in GitHub Desktop.
export function makeCache<Key, Value, ValueMap extends Map<string, Value>>(
hashKey: (key: Key) => string,
valueCodec: Codec<Value>,
fetchValueMap: (keys: readonly Key[]) => EitherAsync<string, ValueMap>,
ttl: number
{
// ValueMap is used here lots too
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment