anthonyshort / deku

Render interfaces using pure functions and virtual DOM
https://github.com/anthonyshort/deku/tree/master/docs
3.42k stars 131 forks source link

Add missing `arrow` in documentation #313

Closed gillstrom closed 8 years ago

gillstrom commented 8 years ago

If I'm not mistaken arrows is missing in those functions.

anthonyshort commented 8 years ago

Whoops! Thanks.

stevenmiller888 commented 8 years ago

You don't need an arrow here

e.g. https://github.com/lukehoban/es6features#enhanced-object-literals

anthonyshort commented 8 years ago

@stevenmiller888 Only if I didn't also have a : there.

render ({ children }) {
  return <button class="my-button">{children}</button>
}

vs

render: ({ children }) => {
  return <button class="my-button">{children}</button>
}
stevenmiller888 commented 8 years ago

Whoops you're right

anthonyshort commented 8 years ago

Pretty much why I don't use those fancy functions in object literals. It's too confusing with the 10 different ways of declaring functions.