Skip to content

KatagiriSo/RDRX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDRX

RDRX is a typescript's Rx library from RxSwift.

const x = list(["hoge","poge","tori"])
    .pipe(map((x) => {
        return x + x;
    }))
    .pipe(flatMap((x) => {
        return just("new!");
    }))
    .pipe(map((x) => {
        return x + "poi";
    }))

x.subscribeOn((x) => {
    if (x.kind == "next") {
        console.log(x.next);
    }
})


const sub = new PublishSubject<string>();

const o = sub.pipe(map((x) => {
    return x + x;
}))

const d = o.subscribeOn((ev) => {
    switch (ev.kind) {
        case "next":
            console.log(ev.next);
            break;
        case "error":
            console.log(ev.error);
            break;
        case "completed":
            console.log("completed");
            break;
    }
})

sub.on(new Next("A"));
sub.on(new Next("B"));
sub.on(new Completed());

sub.on(new Next("D"));

About

typescript RX mini framework (test)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published