import type { Fn0 } from "@thi.ng/api" ; const cache = { } ; param id param factory export const defonce = < T > ( id , factory ) : T => cache . hasOwnProperty ( id ) ? cache [ id ] : ( cache [ id ] = factory ( ) ) ;