There are TODO's in a few places.
Was only going to make a few tweaks then got carried away sorry :P
The parser now just parses the string from the hyperdeck and returns the nice object. It returns the "type" which is either "synchronousFailure", "synchronousSuccess", or "asynchronous", and the data.
The new ResponseHandler listens on the socket and handles everything coming in. It first parses what it gets with the Parser, then will fire synchronousResponse or asynchronousResponse. For synchronousResponse's the payload is an object of {success: << true if success response code >>, data: << the parsed data object >>}, and asynchronousResponse is just the data from the parser.
The notifier in Hyperdeck will emit asynchronousEvent with the parsed data as the payload for any asynchronous events from the hyperdeck.
There are TODO's in a few places. Was only going to make a few tweaks then got carried away sorry :P
The parser now just parses the string from the hyperdeck and returns the nice object. It returns the "type" which is either "synchronousFailure", "synchronousSuccess", or "asynchronous", and the data.
The new
ResponseHandler
listens on the socket and handles everything coming in. It first parses what it gets with theParser
, then will firesynchronousResponse
orasynchronousResponse
. ForsynchronousResponse
's the payload is an object of{success: << true if success response code >>, data: << the parsed data object >>}
, andasynchronousResponse
is just the data from the parser.The notifier in
Hyperdeck
will emitasynchronousEvent
with the parsed data as the payload for any asynchronous events from the hyperdeck.