Comparing version 1.0.1 to 1.0.2
@@ -7,2 +7,3 @@ 'use strict'; | ||
let currentInstance = null; | ||
let isSingleton = false; | ||
const checkConflict = (instance) => { | ||
@@ -20,5 +21,7 @@ if (currentInstance && currentInstance !== instance) { | ||
currentInstance = instance; | ||
isSingleton = true; | ||
}, | ||
unset: () => { | ||
currentInstance = null; | ||
isSingleton = false; | ||
}, | ||
@@ -30,6 +33,10 @@ call: (instance, cb) => { | ||
const res = cb(); | ||
currentInstance = null; | ||
if (!isSingleton) { | ||
currentInstance = null; | ||
} | ||
return res; | ||
} catch (err) { | ||
currentInstance = null; | ||
if (!isSingleton) { | ||
currentInstance = null; | ||
} | ||
throw err; | ||
@@ -36,0 +43,0 @@ } |
{ | ||
"name": "unctx", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Composition-api in Vanilla js", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/unctx", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12011
7
135