Returns a global singleton function. f is a function of no
arguments that creates and returns some object. The singleton
function will call f just once, the first time it is needed, and
cache the value for all subsequent calls.
Warning: global singletons are often unsafe in multi-threaded code.
Consider per-thread-singleton instead.
Comments top
No comments for global-singleton. Log in to add a comment.