Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Make a distinction between error frame and close event callback? #12

Open
yeyu456 opened this issue Jun 7, 2016 · 1 comment
Open

Comments

@yeyu456
Copy link
Contributor

yeyu456 commented Jun 7, 2016

I check the souce code. And found that error frame and close event share the same callback.Shouldn't we use two different function since they are different case.For now i have to use connect failed callback function below:

function callback(evtOrFrame) {
    if (evtOrFrame) {
        if (evtOrFrame.hasOwnProperty("type") && evtOrFrame["type"] === "close") {
            //do something with close event obj
        } else if (evtOrFrame.command === "ERROR") {
            // do something with error frame obj
        }
    }
}
@JSteunou
Copy link
Owner

JSteunou commented Jun 7, 2016

Agreed, the actual close event bother me.

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

No branches or pull requests

2 participants