This project is read-only.

Depricate JsonEncodedEventMessage Args[] array - to single Arg / object

Coordinator
Jun 27, 2012 at 12:44 AM

Looking for feedback on the need for JsonEncodedEventMessage to continue support for an array of Args?

Currently - if you are passing back some arbitrary json data, on the client you would get the object as:

socket.On("update", (data) =>
{
	// cast message as Part - use type cast helper
	Part part = data.Json.GetFirstArgAs<Part>();
	Console.WriteLine(" Part Level:   {0}\r\n", part.Level);
});

Rarely do I see a need to send back an array of disjointed objects - vs wrapping said payload within an object.

Proposed, would be more along the lines of:

socket.On("update", (data) =>
{
	// cast message as Part - use type cast helper
	Part part = data.Json.As<Part>();
	Console.WriteLine(" Part Level:   {0}\r\n", part.Level);
});