This course has been updated! We now recommend you take the Hardcore Functional Programming in JavaScript, v2 course.
Transcript from the "Final Thoughts" Lesson
[00:00:04]
>> Joe Nelson: We had two streams we ended up making, our search input and our click stream. Clicks stream, how would we read this? What happens?
>> Brian Lonsdorf: Well, we just left it messy with the inner compose [CROSSTALK].
>> Joe Nelson: There's a cool part of it actually because what we did is we put it on document.
[00:00:20] We found toDocument so that was the maybe thing. You remember that, Brian?
>> Brian Lonsdorf: Yeah. It's in that YouTube ID where you try to get the YouTube ID at any document click. So we just take any document click and put it in a maybe. And then if it doesn't have a YouTube ID on it, if it's not an element with a YouTube ID we just don't run the player.
[00:00:40]
>> Joe Nelson: So when I'm clicking around on the page but not on an LI It gets to click. It goes through the stream. It eventually hits this YouTube ID thing. Actually, yeah it tries. But this could return like not a maybe, like a bad maybe. Maybe you don't map over because the thing you clicked on, didn't have a dated YouTube ID.
[00:00:59] Had you clicked on the list, though, it'll get picked up and it'll get what it needs. So, the click could be anything. I don't know how sound it is, but it's fun. It's interesting to see that you click anything and it knows what to do because it's in the right functors.
[00:01:16]
>> Brian Lonsdorf: The bottom line there, I think we'd probably factor a little bit before pushing main thing because that's just kinda like why are we map composing this stuff. Like Player creates pure, why doesn't that go up there I would probably put the player create inside of some kind of just returning HTML.
[00:01:32] So we're saying on value get the YouTube ID why not just get the player right there and then we'll set the HTML to the player?
>> Joe Nelson: I think the reason it didn't come up in regular Chrome is because of an iFrame restriction of some kind like a YouTube.
[00:01:45]
>> Brian Lonsdorf: Yeah, but I was just pointing out, these are just like what puts together before I wish we'd refactor a bit. Anyway, yeah, I think we should push this through refactor for a second, then push it as an example of something you can do where your whole app is pure, easily tested, memorizable, portable, whatever.
[00:02:06]
>> Joe Nelson: Yeah, so we'll put all my stuff or so, here see you too and all the libraries you saw the slides all over any changes that happened to jazz fans and all the stuff will be available for you to try again and if/when you have questions and all these craziness.
[00:02:26] Just tweet at us or whatever. We're happy to help.
>> Brian Lonsdorf: Yeah, I also said, I didn't have time to get to applicatives and monoids. Those are so much easier than functors and monads. So if you look at the slides and you guys have questions, just email me. Or we can try to have some kind of thread follow up.
[00:02:43] We can talk, maybe we could get an email list of just like, here's the rest of the slides. Ask me questions on the list, or something? I don't know if there's a way to get that. But, yeah, we'll just figure it out. Or we'll set it up and you can sign up.
[00:02:57]
>> Speaker 3: Yeah, we have a forum. We just don't use it, so I can set up a new thread, or whatever, and send everyone to it.
>> Brian Lonsdorf: Cool, yeah. So in case you were dying to hear what applicatives were you could talk to me about it.
>> Joe Nelson: [LAUGH]
>> Brian Lonsdorf: And the other part of it is there's a lens library, that, it's mind-blowing if you know how functors work, otherwise it's just neat, so.
[00:03:18] [LAUGH] If you guys go check out lenses and kind of understand it's built on F map. It's like woah, but that's all I wanted to say.
>> Joe Nelson: That's all I want to say as well.
>> Brian Lonsdorf: Yay.
>> Joe Nelson: Cats