I was bothered by the presented functional implementation; it seemed to use a whole pile of library-specific functions to do the same things base JavaScript already does, just expressed slightly differently.
This would be the code I'd write for the same task, pure JS assuming that fetchData returns an ES6 Promise:
var getIncompleteTaskSummariesForMember = function(memberName) {
return fetchData().then(function(data) {
return data.tasks
.filter(function(task) {
return (task.member == memberName && !task.complete); })
.map(function(task) {
return {
id: task.id,
dueDate: task.dueDate,
title: task.title,
priority: task.priority
}; })
.sort(function(first, second) {
return first.dueDate - second.dueDate; });
}, function(reason) { console.log(reason); });
};
Now, does that count as functional? I'm not sure I really care, but it's certainly JavaScript-ish.