3

I'm looking into Volt as an option for building an Admin interface to our REST API. The API is a separate application. I would like the Admin application to persist data to the API but also store it's own data that is irrelevant to the API (such as admin users and notes on the API data objects) locally.

Is there a way to sync each local change in the Admin with our remote API, like a callback, for example? Or do I need to wait until the Data Provider API is ready as mentioned in the most recent Volt blog post (as of writing)?

Travis Todd
  • 236
  • 2
  • 12

1 Answers1

3

So this is a fairly common thing, so I think long term the solution will be to support multiple stores in an app and have a REST data provider that you can extend. However that might be a while before that's ready. In the mean time, you can always load and save data via tasks. (I realize its not ideal, but it will work right now) Let me know if you need more info on using tasks to load and save. I'll add the REST data provider to the TODO list.

Ryan
  • 956
  • 7
  • 8
  • Thanks Ryan. I looked through the Tasks documentation but am still a bit unclear on when/how to fire them. – Travis Todd Jun 25 '15 at 14:10
  • So this won't help you on the updating side of things, but a common thing I do with external API's is to call a task when a page action happens (http://docs.voltframework.com/en/docs/callbacks_and_actions.html), then take the results of the task and place it into the ```page``` collection. Then from the view/controller I can access the data. – Ryan Jun 25 '15 at 16:19