Comparing version 0.0.37 to 0.0.38
@@ -59,2 +59,5 @@ declare global { | ||
numNodes: number; | ||
isFragment: boolean; | ||
hasMounted: boolean; | ||
hasUnmounted: boolean; | ||
}; | ||
@@ -61,0 +64,0 @@ export declare type NodeAttachedState = { |
@@ -258,3 +258,5 @@ "use strict"; | ||
function addNewComponent() { | ||
const args = { element: { componentIndex } }; | ||
const args = { | ||
element: { componentIndex }, | ||
}; | ||
const ctor = forgoElement.type; | ||
@@ -273,2 +275,5 @@ const component = ctor(forgoElement.props); | ||
numNodes: 0, | ||
isFragment: false, | ||
hasMounted: false, | ||
hasUnmounted: false, | ||
}; | ||
@@ -294,2 +299,3 @@ const statesToAttach = pendingAttachStates.concat(newComponentState); | ||
if (renderResult.nodes.length > 1) { | ||
newComponentState.isFragment = true; | ||
newComponentState.args.element.node = renderResult.nodes[0]; | ||
@@ -330,2 +336,3 @@ } | ||
componentState.args.element.node = renderResult.nodes[0]; | ||
componentState.isFragment = true; | ||
} | ||
@@ -432,4 +439,5 @@ return renderResult; | ||
const state = states[j]; | ||
if (state.component.unmount) { | ||
if (state.component.unmount && !state.hasUnmounted) { | ||
state.component.unmount(state.props, state.args); | ||
state.hasUnmounted = true; | ||
} | ||
@@ -446,4 +454,5 @@ } | ||
const state = states[j]; | ||
if (state.component.mount) { | ||
if (state.component.mount && !state.hasMounted) { | ||
state.component.mount(state.props, state.args); | ||
state.hasMounted = true; | ||
} | ||
@@ -470,3 +479,3 @@ } | ||
const element = node; | ||
// If the candidate has a key defined, | ||
// If the candidate has a key defined, | ||
// we don't match it with an unkeyed forgo element | ||
@@ -473,0 +482,0 @@ if (element.tagName.toLowerCase() === forgoElement.type && |
{ | ||
"name": "forgo", | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"main": "./dist", | ||
@@ -5,0 +5,0 @@ "author": "Jeswin Kumar<jeswinpk@agilehead.com>", |
@@ -133,2 +133,5 @@ declare global { | ||
numNodes: number; | ||
isFragment: boolean; | ||
hasMounted: boolean; | ||
hasUnmounted: boolean; | ||
}; | ||
@@ -574,3 +577,5 @@ | ||
function addNewComponent(): RenderResult { | ||
const args: ForgoRenderArgs = { element: { componentIndex } }; | ||
const args: ForgoRenderArgs = { | ||
element: { componentIndex }, | ||
}; | ||
@@ -592,2 +597,5 @@ const ctor = forgoElement.type; | ||
numNodes: 0, | ||
isFragment: false, | ||
hasMounted: false, | ||
hasUnmounted: false, | ||
}; | ||
@@ -628,2 +636,3 @@ | ||
if (renderResult.nodes.length > 1) { | ||
newComponentState.isFragment = true; | ||
newComponentState.args.element.node = renderResult.nodes[0]; | ||
@@ -698,2 +707,3 @@ } | ||
componentState.args.element.node = renderResult.nodes[0]; | ||
componentState.isFragment = true; | ||
} | ||
@@ -854,4 +864,5 @@ | ||
const state = states[j]; | ||
if (state.component.unmount) { | ||
if (state.component.unmount && !state.hasUnmounted) { | ||
state.component.unmount(state.props, state.args); | ||
state.hasUnmounted = true; | ||
} | ||
@@ -872,4 +883,5 @@ } | ||
const state = states[j]; | ||
if (state.component.mount) { | ||
if (state.component.mount && !state.hasMounted) { | ||
state.component.mount(state.props, state.args); | ||
state.hasMounted = true; | ||
} | ||
@@ -907,3 +919,3 @@ } | ||
const element = node as HTMLElement; | ||
// If the candidate has a key defined, | ||
// If the candidate has a key defined, | ||
// we don't match it with an unkeyed forgo element | ||
@@ -910,0 +922,0 @@ if ( |
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
115060
2040