-
Notifications
You must be signed in to change notification settings - Fork 852
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
A channel augmenter that encodes and decodes messages as JSON #3309
A channel augmenter that encodes and decodes messages as JSON #3309
Conversation
|
return { | ||
...channel, | ||
on(type, listener, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to Object.freeze
this?
I know technically the RpcSubscriptionsChannel
type only has two functions (send
and on
) but since we're destructuring the inner object here, it may be useful to freeze it.
7e8d6ca
to
f44dc4a
Compare
fd5fc49
to
1ac504b
Compare
1ac504b
to
a721e9a
Compare
f44dc4a
to
d32e6d6
Compare
3007e83
to
12931ce
Compare
Merge activity
|
12931ce
to
0d9069a
Compare
Summary
The new web socket channel speaks in strings/buffers. For general use in the JSON RPC Subscriptions API we need it to take in JavaScript objects, send JSON strings over the wire, and parse the strings that come back as JSON.
This is a higher-order component that wraps a
RpcSubscriptionsChannel
that speaks in strings, and makes it speak in JavaScript objects.