question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pubish() should be able to take a JS object as input

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
marcusradellcommented, Jul 30, 2018

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.

3reactions
sterencommented, May 1, 2018

This would improve the developer experience by simplifying a very common use case. See my first message in this issue to understand the difference.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found