NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore

Home Page:http://docs.nativescript.org/runtimes/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reload runtime programmatically

kiontupper opened this issue · comments

I've looked and haven't found any way to do this but there should be a way to "reload" the runtime without just closing the app. In android, the app can be restarted, but even that might make your users think the app has crashed.

Note I'm not taking LiveSync/LiveEdit. I don't need to reload all of the javascript files and sync everything. This is a simple "kill the runtime, clear the view, and start again" scenario for production. Think location=location; in Cordova.

Being able to restart the app, analogous to reloading the WebView in cordova, would make handling edge-cases a lot easier without having to come up with new routes for everything. For example, if the user is signed out by another device, rather than having to code the logic for tracking and cancelling http requests and other Promises, a developer could just alert the user and reload the app.