Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

The subscribe magic disappeared #31

Open
kyo4311 opened this issue Jul 8, 2016 · 0 comments
Open

The subscribe magic disappeared #31

kyo4311 opened this issue Jul 8, 2016 · 0 comments

Comments

@kyo4311
Copy link

kyo4311 commented Jul 8, 2016

$(document)
    .readyAsObservable()
    .flatMap(function(obj) {
        return $.ajaxAsObservable({
            url: 'cityList',
            dataType: 'jsonp'
        });
    })
    .flatMapLatest(function(res) {
        return res.list; // is Arrary
    })
    .reduce(function(acc, x, idx, source) {
        alert(acc); //has data
        return acc + '<div></div>';
    }, '')
    .subscribe(function(x) {
            alert(x); //Does not perform
        }, function(err) {
            alert(err); //Does not perform
        },
        function() {
            alert('Completed'); //Does not perform
        });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant