pubish() should be able to take a JS object as input
See original GitHub issueI wanted to publish a JSON payload to a topic:
Observed:
const data = JSON.stringify({ hello : "world" });
const dataBuffer = Buffer.from(data);
await publisher.publish(dataBuffer);
Expected:
await publisher.publish({ hello : "world" });
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to store HTML form input as JavaScript Object
You could use a click handler like. var list = [], $ins = $('#firstName, #middleName, #lastName'), counter = { firstName: {}, middleName: {} ......
Read more >Sending forms through JavaScript - Learn web development
The FormData object can be used to build form data for transmission, or to get the data within a form element to manage...
Read more >Save user form input data in a JavaScript object - YouTube
Source code: https://openjavascript.info/2022/10/0... ⚡ Looking for high-performance, afforable web hosting? We use HostWithLove: ...
Read more >Metadata syntax for GitHub Actions - GitHub Docs
You can create actions to perform tasks in your repository. Actions require a metadata file that uses YAML syntax.
Read more >Working with forms - Django documentation
where: the URL to which the data corresponding to the user's input should be ... GET and POST are the only HTTP methods...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d love for it to be another method name for such a function, like
.publishJson()
. Having the same method do multiple things and then sending it over the wire makes things harder to debug when someone sends in the wrong argument. And not even typescript will help in this case since any object shape will be allowed.This would improve the developer experience by simplifying a very common use case. See my first message in this issue to understand the difference.