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

adding binaryType to opts #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

adding binaryType to opts #51

wants to merge 1 commit into from

Conversation

avimak
Copy link

@avimak avimak commented May 28, 2019

@lukeed
Copy link
Owner

lukeed commented May 28, 2019

Hey there~!

Do you not like setting the property inside onopen? I mentioned that here: #18 (comment)

Not quite sure how I feel about this to be honest. I know it sounds silly, but ideologically, Sockette is just meant to enable easy reconnects. It should provision those listeners & be a doorway into the ws connection.

@avimak
Copy link
Author

avimak commented May 29, 2019

I don't mind setting it inside onopen, but since there were already existing methods which aren't related - directly - to reconnecting, i.e. -

    $.json = function (x) {
        ws.send(JSON.stringify(x));
    };

or -

    $.send = function (x) {
        ws.send(x);
    };

or even -

    ws.onmessage = opts.onmessage || noop;

I thought that adding binaryType to opts wouldn't break the current "paradigm".

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

Successfully merging this pull request may close these issues.

2 participants