Learn how to get started with Electron and Angular (Create a Win, Mac, & Linux App with one code base). Discover how powerful Angular pipes can be for an advanced search & filter functionality. Find out how functional programming can in places simplify your code.
16. Anatomy of a pipe
2)Transform input
1) Declare name
3) Return output
length.pipe.ts
17. How pure are your pipes?
pure impure
pure: false
changes when
string/number/boolean input changes or
object reference of date/array/function/object
every mouse move, keystroke,
timer tick, server response
default
23. Pure functions
• Think “pure pipe” with no side effects • Data “flows” through it
Bonus:
• unit testing is a breeze
• portable
• parallelizable
• Output of function 100% determined by input • Deterministic
26. “It's also easier to get started in [JavaScript]
since it's mixed paradigm and you can fall
back on your current practices while there
are gaps in your knowledge.”
27. In my app:
• Refactored one function at a time
• Any state used inside, became an input (parameter),
• Moved state ‘back’ to whoever called the function
• Moved to separate file once function “purified”
• “cheated” by strategically allowing some side-effects
35. Charityware
• $3.50 of every purchase goes to a cost-effective charity
most/all proceeds go to charity
Video Hub App
• Pay what you want, $5 minimum