Skip to content
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

Expose transit.encoder factory fn #23

Open
moll opened this issue Jan 19, 2015 · 2 comments
Open

Expose transit.encoder factory fn #23

moll opened this issue Jan 19, 2015 · 2 comments

Comments

@moll
Copy link

moll commented Jan 19, 2015

We expose transit.decoder so that users can decode already parsed JSON. However there is no analogous transit.encoder encoder factory function that takes an Object graph and returns the JSON Object graph prior to string serialization.

@swannodette swannodette changed the title Encoding an object to an object Expose transit.encoder factory fn Jan 20, 2015
@abhishiv
Copy link

abhishiv commented Oct 7, 2015

I would like that too!

I'm using transit for a not too big data structure, but one that changes too often - several times in a second, and calling JSON.parse to read the object from string seems to block the thread.

@glenjamin
Copy link

I'd like this too - when passing data from the server to the client via a JS literal, this allows skipping the intermediary string:

var __STATE = ["^", // ...
// vs
var __STATE = '["^", // ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants