Transcript from the "Talking to JS Exercise" Lesson
>> Richard Feldman: Which brings us to the exercise in localForaging, Part 9.
>> Richard Feldman: All right.
[00:00:27] Because this index.html file lives in the server, and is not particular to any one of these exercises. So inside the public directory, we can open up, yeah, index.html. And inside of here, we can see a bunch of random stuff, that's just like the fav icon, and the fonts.
[00:00:47] And the style sheet, and all that good stuff, here's the script importing localForage, and elm.js. Which is our compiled Elm code, I put a little. [LAUGH] A little welcome here, in case people looked into this earlier on the exercises.
>> Richard Feldman: But basically, on the Elm side, all we're gonna need to do is make changes to stuff on the part9 directory.
[00:01:06] This is really just for our reference, so we can see in here. We're doing initially, localforage.getItems ("session"). And we're using that to kick-off this initial flags value we're passing into Elm. Saying, okay, this is the initial section value, then we're setting up a subscription here. Sorry, we're doing app.ports.storeSession.subcribe, which is to say.
[00:01:26] Every time Elm sends us a command through a port-named store session. We wanna run this function that receives the new session, and sets it in localForage. And then, finally, after we get the new session, we're going to just call, app.ports.onSessionChange. And send the new session to that, such that, it will now receive that session through the subscription.
[00:02:09] We just need to remember the names, so the exercise is to add the corresponding ports to Session.elm.
>> Richard Feldman: Okay.
[00:02:51] Once we've got both of those implemented, everything should work, and we should once again be able to sign up.