Skip to content

Instantly share code, notes, and snippets.

@web20opensource
Last active August 29, 2015 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save web20opensource/480610c19459be2cb1bc to your computer and use it in GitHub Desktop.
Save web20opensource/480610c19459be2cb1bc to your computer and use it in GitHub Desktop.
Learning RxJs
return movieLists.map(
// map receives 3 args
// cat - element to iterate
// cIndex - index in the array of the element
// cCollection - movieLists array
// same applies for the rest if the code
(cat, cIndex, cCollection) => {
//v for videos object
return cat.videos.map ( (v,vIndex,vCollection) => {
//if you open the debugger (F12) you will see the variables values
debugger;
//pressing F11 in the next line and with some good luck you can see the code of ex 7
return v.boxarts.filter( (box,bIndex,bCollection) => {
debugger;
//using coercion with double equals cool!
return box.width=='150'
})
.map( (filteredResult,fRIndex,fRCollection) => {
debugger;
return {
'id': v.id ,
'title' : v.title ,
'boxart': filteredResult.url
}
})
}).concatAll()
}).concatAll()
@web20opensource
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment