Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream API(WebSocket)が異常終了を検知できない #59

Closed
potproject opened this issue May 25, 2020 · 1 comment
Closed

Stream API(WebSocket)が異常終了を検知できない #59

potproject opened this issue May 25, 2020 · 1 comment

Comments

@potproject
Copy link
Owner

potproject commented May 25, 2020

onErrorをキャッチしてない、と言うのもPromiseにしてるとキャッチできない

https://github.com/potproject/ikuradon/blob/master/app/services/Stream.js
と言うかこの設計・・・Promiseだと無理やな
open -> this.ws[reducerType].onopen() -> resolveした後にこのPromiseはfulfilledまたはrejectedになり終了してしまうので
onerrorを当然察知することはできない、と言うかこんな使い方したらどんな挙動になるんだろう、気になる

WebSocketはReactであれば相性が良さげなので、onErrorやonCloseをReduxでDispatchしたほうが良いね、WebSockerを静的クラスのServiceとして使うのはちょっと無理ある

直そう

@potproject
Copy link
Owner Author

beta7できっと直るよ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant