okwolf / hyperapp-logger

Log Hyperapp state updates and action information to the console.
MIT License
47 stars 5 forks source link

Add tests & update instructions. #1

Closed jorgebucaran closed 7 years ago

jorgebucaran commented 7 years ago

cc @okwolf.

okwolf commented 7 years ago

@jbucaran any reason for using Upper Case for Logger? It looks like it should be a component. Since it's a function, I'm used to going with lower case.

jorgebucaran commented 7 years ago

@okwolf In hyperapp we don't use classes / constructors, so we don't generally need to follow that convention and it's also how the Router works too.

The module exports a function so you can always...

import logger from "hyperapp-router"

...if you want though.

okwolf commented 7 years ago

@jbucaran I guess it matters more for the global for use in browsers.

jorgebucaran commented 7 years ago

@okwolf React's global is also React and ReactDOM. It also looks good, but I guess that's a matter of taste too.

okwolf commented 7 years ago

@jbucaran should the global for Hyperapp be Hyperapp then? 😉

jorgebucaran commented 7 years ago

@okwolf Yes, I think so. That should be the way to go. Or not, maybe only mixins?

/cc @MatejMazur @Zaceno @Jamen @Andyrj @Selfup

okwolf commented 7 years ago

@jbucaran is upper case used by many mixins in the wild outside of Hyperapp? I see some examples to the contrary.

jorgebucaran commented 7 years ago

@okwolf Most modules are a single default export so if the exported global is lowercase or uppercase, I don't mind.

But in the router, we export two things and the default export is actually { Router, Link }. Link is a component, and those must be uppercase. The Router is mixin, not a component, so it doesn't really matter. I made it uppercase because I felt it was more aesthetically pleasing though, but I can change my mind if that's how people like it.

jorgebucaran commented 7 years ago

@okwolf Let's go with lowercase then. I'll update the router later.

okwolf commented 7 years ago

@jbucaran thanks for the updates. I'm ready to merge if you're happy.

jorgebucaran commented 7 years ago

👍