News for hackers. Stuff that matters.
Re:RE:DOM – Tiny DOM library by emilsedgh on Sunday August 28, 2016 @08:12PM (#12379211)
That is an arrow function.

children() is supposed to take a function as argument and that function is supposed to return the list of children.

So basically:

children( function(el) {

  return [

    el.email = input(props({ type: 'email' })),

    el.pass = input(props({ type: 'pass' })),

    el.submit = button(text('Sign in'))

  ]
} )

Also,

[

   el.email = input(props({ type: 'email' }))

   ,

   ...
]

is a neat idea. In one (expressive) line he is assigning the value to the array and also giving the child (in this case, email) a name and reference in its parent, so later he can just call el.email (in the onsubmit function).

Re:RE:DOM – Tiny DOM library by pkstn on Monday August 29, 2016 @01:54AM (#12380266)
Yeah, I'm using similar technique with FRZR as well (https://frzr.js.org), but with RE:DOM I wanted to experiment with ES2015 and also break the API to smaller parts, which you can replace with your own if you like..
Re:RE:DOM – Tiny DOM library by akst on Sunday August 28, 2016 @09:05PM (#12379371)
At first I was gonna say, this could be expressed with an object expression, but actually if you think about it object expressions don't grantee ordering of it's elements, that and you could probably don't need a reference to all children of a component.