Electron Fundamentals, v2 Custom Menu Item Exercise
This course is out of date and does not reflect our standards or industry best practices.
Transcript from the "Custom Menu Item Exercise" Lesson
>> Steve Kinney: As consistent with our current pattern, I implemented Open and Save for the full markdown file. Do you know what you're gonna implement? SaveHTML, right? So a same basic pattern, I'll save this branch and I'll push it up. And then you're gonna do the same thing. You're gonna add one more menu item called saveHTML.
[00:00:21] If you wanna make it, you don't have to give it an accelerator, I don't know if exporting always will have one. You can give it Cmd+E if you want, Command+Shift+S, whatever makes you the happiest you can go ahead and give it. What we wanna do is same thing, we wanna refactor out that event listener to it's own method, send a message from the main process to the renderer process.
[00:00:40] And then when that happens, go ahead and call that saveHTML function that we already have in the main process.