美文网首页
RxPY & Rxjs

RxPY & Rxjs

作者: cajan2 | 来源:发表于2016-12-17 21:36 被阅读169次

    RxPY

    operators
    http://rxpy.codeplex.com/documentation

    Rxjs

    FRP-slideshare
    Reactive Programming with RxJS
    cycle.js
    rx_practise
    rx5 official web
    rx api效果图网

    reactivex.io

    rxmarbles

    Books

    • Reactive Programming with RxJS, Sergi, 201512
    • Function Reactive Programming, Stephen & Anthony,2016(js,java)
    • Reactive Web Applications, Manuel,201606(Play,akka)

    疑难

    1.flatmaplatest和switch的区别?
    http://www.open-open.com/lib/view/open1479716715173.html
    var source0 = Rx.Observable
    .range(1, 3);
    source0.subscribe(function(x){
    console.log(x);
    });
    下面代码里面包含了两种等价的实现方法

    var source0 = Rx.Observable
    .range(1, 3);
    var source= source0.flatMapLatest(function(x) {
    return Rx.Observable.from([x + 'a', x + 'b']);
    });
    // var source= source0.map(function(x) {
    // return Rx.Observable.from([x + 'a', x + 'b']);
    // }).switch();
    var subscription = source.subscribe(
    function (x) {
    console.log('Next: %s', x);
    },
    function (err) {
    console.log('Error: %s', err);
    },
    function () {
    console.log('Completed');
    });

    // Next: 1a
    // Next: 2a
    // Next: 3a
    // Next: 3b
    // Completed

    相关文章

      网友评论

          本文标题:RxPY & Rxjs

          本文链接:https://www.haomeiwen.com/subject/thromttx.html