Last active
February 25, 2019 08:09
-
-
Save yurafuca/3b7be904ba71f5ca1cf062e762c5016d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * 会場中で,かつ直前まで閉場していて,かつ現在開かれていない放送の id を取得 | |
| * | |
| programs | |
| .register() | |
| .isOnair() | |
| .isClose() | |
| .isNotify() | |
| .commit() | |
| programs.onair(id) | |
| programs.open(id) | |
| programs. | |
| // must be open | |
| ids = programs | |
| .get() | |
| .filter( p => p.status === "onair" ) | |
| .filter( p => p.status !== "open" ) | |
| .filter( p=> ) | |
| // must not be open | |
| ids = programs | |
| .get() | |
| .filter( p => p.status === "onair" ) | |
| .filter( p => p.status === "open" ) | |
| // 通知 | |
| // 自動入場 | |
| programs.select().justNow("open").commit() | |
| programs.is(id, expression) | |
| Api.fetch(id).then(s => { | |
| mustBeOpen = ... | |
| mustBeNotify = ... | |
| mustBeWarn = ... | |
| programs.register(next) | |
| }) | |
| Rx.interval(30, SECONDS).subscribe(() => { | |
| const list = programs.get().filter... | |
| list.forEach(i => { | |
| Notify.fire(i) | |
| }) | |
| }); | |
| Rx.interval(60, SECONDS).subscribe(() => { | |
| programs.select().justNow("open") | |
| await Promise.wait(60) | |
| }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment