Create a gist now

Instantly share code, notes, and snippets.

Embed
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){}
@barneycarroll

This comment has been minimized.

Show comment
Hide comment
@barneycarroll

barneycarroll 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.

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