Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
firstRoot =>
xs
.merge(rememberedVNode$.endWhen(sanitation$), sanitation$)
.map(vnode => vnodeWrapper.call(vnode))
.startWith(addRootScope(toVNode(firstRoot)))
.fold(patch, toVNode(firstRoot))
.drop(1)
.map(unwrapElementFromVNode)
.startWith(firstRoot as any)
.map(el => {
mutationObserver.observe(el, {
childList: true,
attributes: true,
characterData: true,
subtree: true,
attributeOldValue: true,
characterDataOldValue: true,
});
return el;
})
.compose(dropCompletion) // don't complete this stream
firstRoot =>
xs
.merge(rememberedVNode$.endWhen(sanitation$), sanitation$)
.map(vnode => vnodeWrapper.call(vnode))
.startWith(addRootScope(toVNode(firstRoot)))
.fold(patch, toVNode(firstRoot))
.drop(1)
.map(unwrapElementFromVNode)
.startWith(firstRoot as any)
.map(el => {
mutationObserver.observe(el, {
childList: true,
attributes: true,
characterData: true,
subtree: true,
attributeOldValue: true,
characterDataOldValue: true,
});
return el;
})
.compose(dropCompletion) // don't complete this stream
)
export default function injectUI(streamContainer: Element) {
var nfeContainer = document.createElement('div');
nfeContainer.id = 'nfe-container';
streamContainer.appendChild(nfeContainer);
const patch = init([propsModule, attrsModule, eventsModule]);
let vnode = toVNode(nfeContainer);
storePromise
.then(store => {
const render = () => {
const newVnode = h('div#nfe-container', [NewsFeedEradicator(store)]);
patch(vnode, newVnode);
vnode = newVnode;
};
render();
store.subscribe(render);
})
.catch(handleError);
}