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

serialize to plain object? #13

Open
jamesdixon opened this issue Nov 5, 2015 · 8 comments
Open

serialize to plain object? #13

jamesdixon opened this issue Nov 5, 2015 · 8 comments

Comments

@jamesdixon
Copy link

Hi,

In my other issue, I mentioned that my fork was customized to add another serialize() method that would serialize the contents of the store to plain javascript objects that could be then used to pass into my ORM. I know it may be an edge case, but wanted to see if there was any interest in supporting such a thing? Essentially, I'm just creating a plain javascript object that contains attributes and relationships and can then be passed almost directly into my ORM (Bookshelf). The reason for doing this was because the JsonApiDataStoreModel contained a handful of methods and properties that were clogging things up a bit when I passed it around, which means I would have to rip those out before passing them in.

If this is something that you can see to be valuable, more than willing to create a PR with the code I created.

Best,
James

@beauby
Copy link
Owner

beauby commented Nov 5, 2015

Hi James,

Thanks for your interest and work! I personally also think this is an edge case, but let's see if there is traction, in which case I'm not opposed to having it merged.

Cheers,

@jamesdixon
Copy link
Author

Sounds great! Thanks!

@beauby beauby reopened this Nov 5, 2015
@beauby
Copy link
Owner

beauby commented Nov 5, 2015

Let's leave this open in the meantime so that it gets more visibility!

@benaubin
Copy link

+1

@jamesdixon
Copy link
Author

@penne12 you can use my fork, which contains a new method called serializeGeneric() that will output the plain object.

@beauby I know this is only one additional request for this feature, but would there be any harm in including it as an official part of the repo? I'd prefer to use the official repo rather than my own fork going forward. Also, any updates on 3.0?

Cheers.

@beauby
Copy link
Owner

beauby commented Jan 29, 2016

Hi guys,
As it seems this feature is needed by quite some people, I'll merge it soon. @jamesdixon would you mind issuing a PR?

@jamesdixon
Copy link
Author

@beauby I'll do my best to get this in soon. I need to merge in upstream changes and make sure everything still functions as expected.

@beauby
Copy link
Owner

beauby commented Jan 29, 2016

Awesome, thanks a lot!
As far as the next version is concerned, I'll cut 0.3.3-beta as soon as your PR is merged, and then clean out some stuff before cutting 1.0.

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

No branches or pull requests

3 participants