Closed sachin0606 closed 6 years ago
apis are by default synchronous in JsStore.
Here is a example to test this - you call two apis - insert first and after that select. So first insert will be executed and after that select . Baiscally call to apis will be executed in the same order as they are called one after one.
how to get the offline mofied data [changed data] from jsstore. and send to server to update the data.
You need to check whether user is online or offline. So if user is online then sync with server and if offline save the data in jsstore.
here is doc for checking online and offline - https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/Online_and_offline_events
I will create a demo for this.
My Scenario is to get the changed data while offline and send it to server and get the data from server which is updated while the device is offline.
indirect offline sync.
This requirement is for something like a chat or live application?
User logged in, some data is downloaded and saved into indexeddb. The process continues and when the user goes offline , the data is saved or updated into indexeddb. Now this data needs to be sent to server or sync data with server when user comes online.
This will be a use case of above scenario.
yes. exactly.
Hi @sachin0606, Here is a Chat room demo made using Jsstore. Have a look and i guess you will get the idea for your query and the code as well.
@sachin0606 - Are we good here. Please let me know.
Thanks
Hope above solutions is working for you , if not let me know. Closing the issue for now, feel free to reopen.
Thanks
Please provide any example to use api sync for offline sync data.