javascript - Is it possible to call a function ONLY on the first run? -


i developing app using telerik's nativescript. know whether it's possible call function first time app ran, not each consecutive run.

my first thoughts ship 1 line text file content false. on first run check file , value. if false i'd run function , update text file content true, otherwise i'd let app continue normal.

i think there must better, more efficient way this. ideas folks?

i've no idea why you're getting these browser technology answers you're using nativescript want take @ application settings module.

a value set application settings persist long app installed on device. if user re-installing app it'll (of course) reset.

it's easy as:

var appsettings = require("application-settings"); if(!appsettings.getboolean("hasrunned", false)) {     // stuff want on first run     // , set true     appsettings.setboolean("hasrunned", true); } 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -