@goji/core
Advanced tools
Comparing version 0.6.6 to 0.6.7
@@ -22,3 +22,3 @@ "use strict"; | ||
if (!componentInstance && subtreeId !== undefined) { | ||
componentInstance = new Promise((resolve) => { | ||
componentInstance = new Promise(resolve => { | ||
subtreeAttachEvents_1.default.on(String(subtreeId), () => resolve(publicInstance_1.subtreeInstances.get(subtreeId))); | ||
@@ -25,0 +25,0 @@ }); |
@@ -6,4 +6,4 @@ import { ElementInstance } from './instance'; | ||
unsafe_gojiId: number; | ||
getComponentInstance?: () => Promise<ComponentInstance>; | ||
getComponentInstance: () => Promise<ComponentInstance>; | ||
} | ||
export declare const subtreeInstances: Map<number, any>; |
@@ -18,3 +18,3 @@ import { ElementInstance, TextInstance } from './instance'; | ||
if (!componentInstance && subtreeId !== undefined) { | ||
componentInstance = new Promise((resolve) => { | ||
componentInstance = new Promise(resolve => { | ||
events.on(String(subtreeId), () => resolve(subtreeInstances.get(subtreeId))); | ||
@@ -21,0 +21,0 @@ }); |
@@ -6,4 +6,4 @@ import { ElementInstance } from './instance'; | ||
unsafe_gojiId: number; | ||
getComponentInstance?: () => Promise<ComponentInstance>; | ||
getComponentInstance: () => Promise<ComponentInstance>; | ||
} | ||
export declare const subtreeInstances: Map<number, any>; |
{ | ||
"name": "@goji/core", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"description": "GojiJS Core", | ||
@@ -94,3 +94,3 @@ "main": "dist/cjs/index.js", | ||
}, | ||
"gitHead": "60e5c114ceaa6cd2e4ce27cc89ddb09a33cece1b" | ||
"gitHead": "528465c0f3616a52e25dce5764f15affbbf756f6" | ||
} |
@@ -32,10 +32,11 @@ import { Container } from '../container'; | ||
// If `attached` run before `getPublicInstance` we can get the component instance in sync | ||
let componentInstance = | ||
Promise.resolve(subtreeId !== undefined && subtreeInstances.has(subtreeId) | ||
let componentInstance = Promise.resolve( | ||
subtreeId !== undefined && subtreeInstances.has(subtreeId) | ||
? subtreeInstances.get(subtreeId) | ||
: undefined); | ||
: undefined, | ||
); | ||
// if `attached` have not run, we should wait for attach been called | ||
if (!componentInstance && subtreeId !== undefined) { | ||
componentInstance = new Promise((resolve) => { | ||
componentInstance = new Promise(resolve => { | ||
events.on(String(subtreeId), () => resolve(subtreeInstances.get(subtreeId))); | ||
@@ -42,0 +43,0 @@ }); |
@@ -10,5 +10,5 @@ import { ElementInstance } from './instance'; | ||
unsafe_gojiId: number; | ||
getComponentInstance?: () => Promise<ComponentInstance>; | ||
getComponentInstance: () => Promise<ComponentInstance>; | ||
} | ||
export const subtreeInstances = new Map<number, ComponentInstance>(); |
Sorry, the diff of this file is not supported yet
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
12556
1566560