OfficeDev / script-lab

Create, run and share your code directly from Office
MIT License
701 stars 160 forks source link

Make Custom Functions AsyncStorage communication more efficient #236

Open Zlatkovsky opened 5 years ago

Zlatkovsky commented 5 years ago

After porting over the existing CF AsyncStorage custom functions logic, should do the following improvements:

  1. Only write to local storage if a dashboard is present.
  2. Rather than constantly writing (in a loop), only write when a new entry is ready to be written. (Did a loop because it looked like some other keys were being written to as well, like the heartbeat last-alive moment -- but it looks like those aren't used anymore. So clean up and make more efficient instead).
  3. Make sure that even if fail to write to storage, that function still works.
Zlatkovsky commented 5 years ago

I believe the AsyncStorage implementation already is more efficient in the new Script Lab than in the old one, since it comes from a refactored version at https://github.com/OfficeDev/script-lab-2017/compare/CleanerAsyncStorage/

However, that reminds me that we should port over that precompiled source back into the Script Lab of today. Opening https://github.com/OfficeDev/script-lab/issues/523 for it.