00:03:43  * kazuponjoined
00:07:02  * mhernandez1joined
00:09:00  * kazuponquit (Remote host closed the connection)
00:10:59  * Foxandxssquit (Quit: Textual IRC Client: www.textualapp.com)
00:11:11  * mhernandez1quit (Remote host closed the connection)
00:20:49  * TheThingquit (Remote host closed the connection)
01:26:51  * kazuponjoined
01:30:27  * niftylettucejoined
01:57:33  * greldoquit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:43:40  * greldojoined
03:18:09  * rickharrisonquit (Ping timeout: 276 seconds)
03:19:20  * rickharrisonjoined
03:35:41  * TheAceOfHeartsjoined
03:41:39  * greldoquit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:03:58  * kazuponquit (Remote host closed the connection)
04:14:13  * macwinnerquit (Remote host closed the connection)
05:02:29  * kazuponjoined
05:03:48  * niftylettucequit (Quit: Connection closed for inactivity)
05:14:30  <ASEV>hello, what is the benefit of using generators when setting up routes in koa?
06:13:13  <TheAceOfHearts>you can have real middleware?
06:13:22  <TheAceOfHearts>just like with rack in Ruby
06:26:08  * kazuponquit (Remote host closed the connection)
06:37:02  <ASEV>hmm, thanks TheAceOfHearts. What do you mean with real middleware?
06:37:17  <TheAceOfHearts>real middleware behaves like a stack :D
06:37:24  <TheAceOfHearts>not like a pipeline
06:38:40  <ASEV>ahaa, so the middleware can be involved in various parts of certain action?
06:39:26  <TheAceOfHearts>let me show you an example of how I use it
06:39:45  <ASEV>great!
06:41:18  <TheAceOfHearts>https://github.com/cesarandreu/bshed/blob/master/api/controllers/bikesheds_controller.js look here
06:41:28  <TheAceOfHearts>so, this is an app where I play around with ideas
06:42:12  <TheAceOfHearts>at the top there's static libs, and then I make my controller, which is just a function that returns its middleware + routes
06:43:10  <TheAceOfHearts>so when invoked it'll make auth, loadBikeshed, the body parsers, and the schema checkers
06:43:26  <TheAceOfHearts>then below, line 42 to 48
06:44:04  <TheAceOfHearts>it defines the route POST /bikeshed, and it'll check auth first, then parse the body for files, then check the schema, and then pass it off to the create action
06:44:42  <TheAceOfHearts>does that make sense?
06:46:26  <TheAceOfHearts>https://github.com/cesarandreu/bshed/blob/master/api/controllers/index.js here is the controller loader; it has the list above, and it'll just require em all, instantiate each one, and return the composed result
06:49:54  <TheAceOfHearts>you could generate the list dynamically by reading the folder files, and filtering dot files and index.js
06:51:20  * thaumejoined
06:52:27  <ASEV>i need some time with this :D
06:53:29  <TheAceOfHearts>sure lol
07:03:55  <ASEV>yea, it makes sense
07:04:43  <ASEV>you are using new ecmascript, i never saw it this much
07:05:10  <TheAceOfHearts>yeah :D
07:06:18  <ASEV>but i still didn't get what's the benefit of using generators :D
07:12:36  <ASEV>i'm learning a lot of this bikeshed thing
07:12:38  <ASEV>:D
07:12:40  <ASEV>thanks
07:24:54  <TheAceOfHearts>lol
07:24:55  <TheAceOfHearts>sure
07:25:01  <TheAceOfHearts>the benefit of using generators
07:25:02  <TheAceOfHearts>well
07:25:04  <TheAceOfHearts>it's kind of a hack
07:25:09  <TheAceOfHearts>async/await is what people really want
07:25:30  <TheAceOfHearts>but basically, you can do stuff like… load some models, create others, etc.
07:25:34  <TheAceOfHearts>it just helps with flow control
07:25:58  <TheAceOfHearts>the benefit of using generators is that you can have middleware that behaves like a stack
07:25:59  <TheAceOfHearts>for example
07:26:06  <TheAceOfHearts>you can have a middleware high up
07:26:10  <TheAceOfHearts>that catches all errors
07:26:14  <TheAceOfHearts>and handles em properly
07:28:17  <TheAceOfHearts>anyway, feel free to ping me if you have any questions, I can't promise I'll be able to help, but I can try :P
07:31:37  * enkristofferjoined
07:31:37  <ASEV>okay, thanks!
07:41:34  <ASEV>require(`./${name}_controller.js`), can those `` even work?
07:41:40  <ASEV>i never saw it in javascript
07:43:55  <TheAceOfHearts>it's a new es6 thing :)
07:43:58  <TheAceOfHearts>string interpolation
07:44:16  <TheAceOfHearts>https://babeljs.io/docs/learn-es2015/#template-strings look
07:50:00  * thaumequit (Remote host closed the connection)
07:50:07  * kazuponjoined
08:21:01  * thaumejoined
08:31:53  * thaumequit (Remote host closed the connection)
08:37:47  <ASEV>hmm, i wasn't able to evaluate it with nodejs
08:37:58  <ASEV>does it take something else than --harmony?
08:43:23  <ASEV>so i need babel i guess
08:47:25  <TheAceOfHearts>my code?
08:47:29  <TheAceOfHearts>I'm using babel, yeah
08:47:43  <TheAceOfHearts>if you install iojs, you can do: node -r babel/register ./index.js
08:50:00  * thaumejoined
08:52:41  <ASEV>okayy
08:59:27  * thaumequit (Remote host closed the connection)
09:02:17  * thaumejoined
09:19:11  * Foxandxssjoined
09:21:08  * greldojoined
09:21:58  * greldoquit (Client Quit)
09:24:23  * greldojoined
09:47:52  * yoshuawuytsjoined
10:01:51  * thaumequit (Remote host closed the connection)
10:05:20  * thaumejoined
10:26:43  * greldoquit (Quit: My Mac has gone to sleep. ZZZzzz…)
10:31:20  * greldojoined
10:33:18  * greldoquit (Client Quit)
10:33:58  * greldojoined
11:16:39  * thaumequit (Remote host closed the connection)
12:07:08  * kazuponquit (Remote host closed the connection)
12:07:36  * kazuponjoined
12:12:18  * kazuponquit (Ping timeout: 272 seconds)
12:19:56  * thaumejoined
12:20:06  * thaumequit (Remote host closed the connection)
12:20:19  * thaumejoined
13:18:03  * mhernandez1joined
13:18:06  * mhernandez1quit (Remote host closed the connection)
13:18:25  * mhernandez1joined
13:36:30  * thaumequit (Remote host closed the connection)
13:42:27  * thaumejoined
13:52:04  * greldoquit (Quit: Textual IRC Client: www.textualapp.com)
13:53:06  * TheThingjoined
14:02:54  * thaumequit (Remote host closed the connection)
14:08:44  * thaumejoined
14:11:53  * thaumequit (Remote host closed the connection)
14:12:32  * thaumejoined
14:18:50  * TheThingquit (Remote host closed the connection)
14:30:47  * TheThingjoined
14:53:33  * TheThingquit (Remote host closed the connection)
15:02:42  * kazuponjoined
15:29:19  * thaumequit (Remote host closed the connection)
15:34:41  * thaumejoined
15:47:12  * TheAceOfHeartsquit (Quit: Leaving.)
15:49:16  * yoshuawuytsquit (Ping timeout: 252 seconds)
16:19:18  * tjholowaychukjoined
16:33:56  * TheAceOfHeartsjoined
16:37:28  * tjholowaychukquit (Quit: Lingo: www.lingoirc.com)
16:58:50  * thaumequit
17:04:32  * mhernandez1quit (Remote host closed the connection)
17:04:53  * joshonthewebquit (Quit: Computer has gone to sleep.)
17:06:20  * mhernandez1joined
17:53:21  * kazuponquit (Remote host closed the connection)
17:53:48  * kazuponjoined
17:58:27  * kazuponquit (Ping timeout: 265 seconds)
18:13:03  * MacWinne_joined
18:16:13  * TheAceOfHeartsquit (Ping timeout: 264 seconds)
18:19:30  * TheAceOfHeartsjoined
18:21:01  * TheAceOfHearts1joined
18:23:43  * TheAceOfHeartsquit (Ping timeout: 250 seconds)
18:53:46  * greldojoined
19:14:57  <Foxandxss>I believe there is no counterpart for this: https://github.com/jfromaniello/express-unless
19:14:59  <Foxandxss>right?
19:15:05  <Foxandxss>Not that is hard to create a koa-unless tho
19:43:46  <TheAceOfHearts1>you can just make a function to do your check and either call the middleware or skip it lol
20:27:36  * TheThingjoined
20:32:44  * TheAceOfHearts1quit (Ping timeout: 256 seconds)
20:39:47  * TheThingquit (Ping timeout: 250 seconds)
20:42:50  * TheAceOfHeartsjoined
21:08:36  * TheAceOfHeartsquit (Quit: Leaving.)
21:11:55  * TheAceOfHeartsjoined
21:35:10  * mhernandez1quit (Remote host closed the connection)
22:56:37  * mhernandez1joined
23:04:38  * joshonthewebjoined
23:12:02  * Foxandxssquit (Quit: Textual IRC Client: www.textualapp.com)
23:24:17  * TheThingjoined
23:28:31  * joshonthewebquit (Quit: Computer has gone to sleep.)
23:29:06  * TheThingquit (Ping timeout: 258 seconds)
23:44:01  * corbanbjoined
23:51:53  * kazuponjoined
23:54:09  * kazuponquit (Remote host closed the connection)