Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 811 Bytes

002_modularised_frontend_fp.md

File metadata and controls

41 lines (23 loc) · 811 Bytes

Modularized Front-End. Part 2: FP way

All code examples you can find here

We are going to implement a very simple quiz app. Every question in the quiz should have multiple answers but only one of them is correct. A user can answer a question, navigate between questions back, forth, and by index. And when all the questions are answered one can finish the quiz and see his score.

In the previous article we implemented this logic in the OOP way, and now goes more clean FP one.

How to model data FP way

TODO

Use modules instead of classes

TODO

Everything should be readonly

TODO

Use algebraic data types

TODO

Keep data and operations on data close

TODO

Incapsulation, FP way (Opaque types)

TODO

Render is just a function

TODO