10 lines
256 B
JavaScript
10 lines
256 B
JavaScript
export default function instanceCachingFactory(factoryFunc) {
|
|
let instance;
|
|
return (dependencyContainer) => {
|
|
if (instance == undefined) {
|
|
instance = factoryFunc(dependencyContainer);
|
|
}
|
|
return instance;
|
|
};
|
|
}
|