Comparing version 0.0.2 to 0.0.3
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.0.3](https://github.com/unjs/unctx/compare/v0.0.2...v0.0.3) (2021-03-30) | ||
### Bug Fixes | ||
* add missing return to createNamespace ([04886ef](https://github.com/unjs/unctx/commit/04886efb014f2715de924b936fd7b6b210454531)) | ||
### [0.0.2](https://github.com/unjs/unctx/compare/v0.0.1...v0.0.2) (2021-03-30) | ||
@@ -7,0 +14,0 @@ |
@@ -10,3 +10,3 @@ interface UseContext<T> { | ||
declare function createNamespace(): { | ||
get<T>(key: any): void; | ||
get(key: any): UseContext<any>; | ||
}; | ||
@@ -13,0 +13,0 @@ declare const defaultNamespace: ContextNamespace; |
@@ -21,4 +21,9 @@ 'use strict'; | ||
function createNamespace() { | ||
const contexts = {}; | ||
return { | ||
get(key) { | ||
if (!contexts[key]) { | ||
contexts[key] = createContext(); | ||
} | ||
return contexts[key]; | ||
} | ||
@@ -25,0 +30,0 @@ }; |
{ | ||
"name": "unctx", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"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
9347
85