Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
const hasPromise = retVal.some(ret => Boolean(ret && ret.then));
// This is the only time the return value matters.
if (hasPromise) {
return Promise.all(retVal);
}
}
};
// Save the handler for later unbinding.
boundHandlers.push(handler);
// Add the state handler.
addTransitionState(transitionName, handler);
});
};
const subscribe = () => {
addTransitionState('attributeChanged', attributeChanged);
// Add a transition for every type.
keys(transitionsMap).forEach(name => {
const map = transitionsMap[name];
const transitionName = eventsToTransitionName[name] || name;
const handler = function(child, ...rest) {
// If there are no elements to match here, abort.
if (!map.size) {
return;
}
// If the child element triggered in the transition is the root
// element, this is an easy lookup for the handler.
if (map.has(child)) {
return map.get(child)(child, child, ...rest);
value: (state, callback) => addTransitionState(state, callback),
});