import { memoizeCache } from './cache' ; /**
 * When the result of a function memoized with `memoizeWeak` or `memoizeStrong`
 * is known from an external source such as persisted storage, allows to cache
 * this result without calling the function.
 */ export const teach = < From , To > ( project , from , to ) : void => { const cache = memoizeCache . get ( project ) ; if ( cache === undefined ) { throw Error ( `teach() must be called with a function returned by memoizeWeak() or memoizeStrong().` ) ; } if ( ! cache . has ( from as any ) ) { cache . set ( from as any , to ) ; } } ;