Update the typescript example in README.md#744
Update the typescript example in README.md#744winksaville wants to merge 1 commit intoprotobufjs:masterfrom
Conversation
The update makes the example execute using typescript 2.2.2. The following changes were made. - Changed lookupType parameter to `"awesomepackage.AwesomeMessage"` - Use `let` instead of `var` as its consider a better style - Add type `: any` for message - Add printing of message.awesomeField - Add example of decoding of buffer and printing result - Commented out redundant or non-executable lines
|
I had trouble getting the example working so I thought I provide this PR to help others. I was surprised I needed to explicitly type |
This might be the case because you are accessing its properties with dot syntax ( If you'd like to have proper typings for dynamic messages, too, you could still use pbts-generated typings for its static counterpart with your dynamic code. |
|
Thanks for the feed back and updating README.md |
The update makes the example execute using typescript 2.2.2. The
following changes were made.
"awesomepackage.AwesomeMessage"letinstead ofvaras its consider a better style: anyfor message