The concepts of functional programming have significantly shaped Computer Science from the early days.
Apply some "FP" concepts to the MVC Blog!
We'll make an "admin" page, which will show some stats on how authors on the blog are doing. In the end, it will looks something like this.
Today there are many TODO items, but they are (mostly) smaller bites.
-
Let's make sure each one of our scripts are properly enclosed. Wrap the contents of article.js in an IIFE, just like articleView.js has been. Set up your IIFE so it receives a parameter to which it can attach behavior.
-
For both
index.html
andadmin.html
, we'll want access to theArticle.all
data...but we'll have different view functions to set up each of those pages. Help complete thefetchAll
function so that it calls anext
parameter: a function to invoke when it's work is done. -
Ensure both the index page and the admin page call
fetchAll
in a way that properly triggers the appropriate page setup methods. -
Use chained map/reduce calls to transform the data into what you need it to be.
- What statistical analysis would be of interest to you with this data set? Code it up!