Skip to content

Server Message Constants #161

Description

@wilberforce

https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/network/network.md#callbackmessage-val1-val2-1

The message is an integer - Is there a reason that the class does not define the constants?

Looking at the Pins examples, there are constants within the class for various states.

Something like:

Server.MsgDisconnected = -1;
Server.MsgConnected = 1;
Server.MsgStatus = 2;
Server.MsgHeader = 3;
Server.MsgHeaders = 4;
Server.MsgResponse = 8;
Server.MsgResFragment = 9;
Server.MsgComplete = 10;

I would think that this would make the code more readable - as the numbers on their own mean nothing.

Do you want a pull request for this sort of thing (after discussion?)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions