UNPKG

infrastructure-components

Version:

Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.

11 lines (8 loc) 208 B
// @flow export default function memoize<V>(fn: string => V): string => V { const cache = {} return (arg: string) => { if (cache[arg] === undefined) cache[arg] = fn(arg) return cache[arg] } }