@saber2pr/react
Version:
react in Typescript.
31 lines (30 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Reflection;
(function (Reflection) {
var combiner = new WeakMap();
function setInternalFiber(hookFiber) {
var constructor = hookFiber.tag;
combiner.set(constructor, hookFiber);
}
Reflection.setInternalFiber = setInternalFiber;
function getInternalFiber(hookFiber) {
var constructor = hookFiber.tag;
return combiner.get(constructor);
}
Reflection.getInternalFiber = getInternalFiber;
function setContainerFiber(rootFiber) {
var container = rootFiber.stateNode;
combiner.set(container, rootFiber);
}
Reflection.setContainerFiber = setContainerFiber;
function getContainerFiber(rootFiber) {
var container = rootFiber.stateNode;
return combiner.get(container);
}
Reflection.getContainerFiber = getContainerFiber;
function hasContainerFiber(container) {
return combiner.has(container);
}
Reflection.hasContainerFiber = hasContainerFiber;
})(Reflection = exports.Reflection || (exports.Reflection = {}));