官术网_书友最值得收藏!

Exercise 1.1

Modify the previous example in such a way that the sine wave is drawn using all the colors of the rainbow. The drawing loop should look like the following:

(-> (js/rx.zip sine-wave rainbow-colours) 
    (pipe (rx-take 700))
    (.subscribe (fn [[{:keys [x y]} colour]] 
                  (fill-rect x y colour)))) 

Your task is to implement the rainbow-colours stream. As everything up until now has been very light on explanations, you might choose to come back to this exercise later, once we have covered more about CES.

The repeat, scan, and flatMap functions may be useful in solving this exercise. Be sure to consult RxJs' API at https://rxjs-dev.firebaseapp.com/guide/overview for more information.

主站蜘蛛池模板: 皋兰县| 玛曲县| 顺昌县| 福泉市| 靖西县| 锦屏县| 大庆市| 延长县| 夏邑县| 神池县| 石首市| 无为县| 邯郸市| 仁寿县| 芷江| 新宁县| 翁牛特旗| 揭东县| 盐山县| 巫溪县| 鹿泉市| 巫溪县| 自贡市| 车致| 扬中市| 红安县| 渝中区| 屏东县| 称多县| 凤城市| 浙江省| 巢湖市| 突泉县| 黑龙江省| 开鲁县| 三门县| 城口县| 湘潭市| 邓州市| 开封县| 旌德县|