Skip to content

Instantly share code, notes, and snippets.

@fonzerelly
Last active September 24, 2016 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonzerelly/1b0295bc93bf6eab37fd476301bc0c1d to your computer and use it in GitHub Desktop.
Save fonzerelly/1b0295bc93bf6eab37fd476301bc0c1d to your computer and use it in GitHub Desktop.
-------click-------click---------click------->
**********************************************
----------------"a=1&a=2&b=3"---------------->
**********************************************
------------"a=1&a=2&b=3"-------------------->
observablePerPair
\ \ \
"a=1" "a=2" "b=3"
\ \ \
\ flatmap \
-------------"a=1"--"a=2"--"b=3"------------->
**********************************************
---------------"a=1"--"a=2"--"b=3"----------->
.map(splitEqual)
---------["a", "1"]--["a", "2"]--["b", "3"]-->
**********************************************
-------------------{a: null}----------------->
-------------------{b: null}----------------->
**********************************************
------------["a", "1"]--["a", "2"]----------->
.scan(scanArray)
------------------["1", "2"]----------------->
and
------------------["b", "3"]----------------->
.scan(scanArray)
----------------------["3"]------------------>
**********************************************
------------------["1", "2"]----------------->
.map(extractValueFromSingleArray)
------------------["1", "2"]----------------->
and
---------------------["3"]------------------->
.map(extractValueFromSingleArray)
----------------------"3"-------------------->
**********************************************
//Rx.Observable.just(objectFromKey(obs.key))
-------------------{a:null}------------------>
//obs
-------------------["1","2"]----------------->
**********************************************
--------------{a: null}--["1","2"]----------->
**********************************************
--------------{a: null}--["1","2"]----------->
.scan(scanObject)
------------------{a:['1','2']}-------------->
and
-----------------{b: null}--"3"-------------->
.scan(scanObject)
---------------------{b: 3}------------------>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment