Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
The ability to define virtual DOM structure in one place and have it render in another
const Portal = {
view : ({attrs, content = []}) =>
attrs.view({
outlet: () =>
content,
inlet: (...input) => {
content.splice(0, Infinity, ...input)
},
})
}
try{ module.exports = Portal } catch(e){}
Owner

barneycarroll commented Sep 27, 2017

Streams are an unnecessary dependency and introduce too much ambiguity. Inlet is just a setter. Outlet is just a getter. Remove the dep and make the code more explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment