const fs = require('fs')

const Task = require('data.task')
const { List, Map } = require('immutable-ext')


const httpGet = (path, params) =>

  // mocking 'result' as result of get
  Task.of(`${path} result`)

Map({
  home: '/',
  about: '/about-us',
  blog: '/blog'
})
.traverse(
  Task.of,
  route => httpGet(route, {})
)
.fork( console.error, console.log )



Map({
  home: ['/', '/home'],
  about: ['/about-us']
})
.traverse(
  Task.of,

  // routes are arrays,
  // wrap into List and traverse
  routes => List(routes).traverse(
    Task.of, route => httpGet(route, {})
  )
)
.fork( console.error, console.log )


@@ -154,19 +154,14 @@
 ing 
-'
 re
-sult' as
+turn
  res
@@ -171,16 +171,58 @@
  of get%0A
+  // immeditate task returning the string%0A
   Task.o
@@ -242,16 +242,34 @@
 sult%60)%0A%0A
+%0A// Map of routes%0A
 Map(%7B%0A  
@@ -412,17 +412,39 @@
 log )%0A%0A%0A
+// Map of route arrays
 %0A
-
 Map(%7B%0A  
@@ -518,16 +518,20 @@
 f,%0A%0A  //
+ now
  routes 
@@ -552,16 +552,21 @@
 // wrap 
+them 
 into Lis

Structure async: Update comments