From f4268756921f130cefda74277825903bfd92c99b Mon Sep 17 00:00:00 2001 From: tripathyr Date: Wed, 29 Dec 2021 17:27:02 +0530 Subject: [PATCH] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 566e829..f1b9946 100644 --- a/README.md +++ b/README.md @@ -836,6 +836,14 @@ Sample startup is defined in onLoadStartUp function 2. fn - body of the function Note: startup funtions are called in parallel. Therefore only add custom startup funtion only if it can run in parallel with other startup functions. (default startup funtions are read supernode list and subAdmin list from blockchain API, load data from indexedDB, get login credentials) +```javascript +//Executes automatically on startup before anything else executes +floDapps.addStartUpFunction("myFirstFunction",function (){ return new Promise ((resolve,reject)=>{console.log("First function Excecuted before everything else");resolve("My First Function executed")}); }); + +// Manaul execution on console +floDapps.util.startUpFunctions.myFirstFunction(); +``` + ### Advanced Dapp functions usually not needed for users #### setAppObjectStores