-
Notifications
You must be signed in to change notification settings - Fork 141
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
Example with REST interaction #26
Comments
You can find an example @jordangarcia gave of how Optimizely does async stuff in issue #5. It's not exactly "built-in" to Nuclear, but it's pretty straight-forward. |
Thanks for the link to the issue @mindjuice. I do plan on releasing a standardize Would this be something that both of you would be interested in? If there is a lot of interest I can prioritize it to come out shortly after 0.6.0 is released. |
It's certainly something I would be interested in! I haven't played around I may be interested in contributing if you think an outsider / Nuclear On Sat, Apr 25, 2015 at 12:19 AM Jordan Garcia notifications@github.com
|
I'd be interested in it as well. |
@rattrayalex I am very open to others contributing to this project. Shoot me an email at jordan@optimizely.com and we can discuss more. |
For those interested I have started work on making an example app using a generic Rest API module. Ignore everything outside of modules right now as some of it was copied over from another project. |
Awesome! Sent. On Sat, May 2, 2015 at 10:42 PM Jordan Garcia notifications@github.com
|
Updated the README with a more in-depth description of the architecture and added a User module example. Would love feedback. https://github.com/optimizely/nuclear-js/tree/rest-api-example/examples/rest-api-example/ |
Looks good, except: http://i.imgur.com/X4Fsf96.jpg :-) I know it's only an example, but most people tend to stick closely to the examples. I discourage people from jQuery in general, but especially in React apps. It's a lot of overhead just for the Maybe Superagent instead?
Even XmlHttpRequest or perhaps a promisified version:
There are some Superagent promise wrappers too:
|
@mindjuice that's a good point. I am used to using jQuery at work, I understand it's not ideal for most React apps. I will update the examples using a more lightweight ajax library.. |
Can I suggest you use the |
Hi @jordangarcia, first of all, congrats for your job with nuclear-js. I've just started use nuclear-js for an volunteer project. I'm interested in rest api feature. Do you have plan to create the V2 of rest-api example? |
@mclouvem it's not a huge priority now. If you'd like to implement i'd happily accept PRs :) |
Hi again,
Just checked out the
next-update-readme-example
branch and very impressed with all the progress you guys are making, on docs and code.One thing that seems to be missing is examples around interacting with a REST API for fetching/syncing/saving data. I imagine it'd be fairly straightforward, especially along the lines of a "Web API Utils" idea... but if you guys have patterns that work it might be nice to share them so devs know what to expect & how to architect.
My assumed pattern:
One thing I love about Backbone (and the reason I sometimes use it with Flux/React) is that it takes care of all this stuff for you, including tracking when an item is syncing, synced, invalid, or in an error state. It's also incredibly convenient to just set a
"url"
attribute and then call.save()
. I'm not sure if it makes sense to incorporate all of that into Nuclear, but an example showing it off might be worthwhile.The text was updated successfully, but these errors were encountered: