From 05587f4a72ed666fe9ef3e44ceb3f5ed73ac9df0 Mon Sep 17 00:00:00 2001 From: Cadence Fish Date: Fri, 20 Dec 2019 15:01:07 +1300 Subject: [PATCH] git subrepo clone /home/cloud/Code/pinski-plugins/avc src/site/html/static/js/templates/avc subrepo: subdir: "src/site/html/static/js/templates/avc" merged: "257d397" upstream: origin: "/home/cloud/Code/pinski-plugins/avc" branch: "master" commit: "257d397" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9" --- src/site/html/static/js/templates/avc/.gitrepo | 12 ++++++++++++ src/site/html/static/js/templates/avc/avc.js | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/site/html/static/js/templates/avc/.gitrepo create mode 100644 src/site/html/static/js/templates/avc/avc.js diff --git a/src/site/html/static/js/templates/avc/.gitrepo b/src/site/html/static/js/templates/avc/.gitrepo new file mode 100644 index 0000000..cf738e7 --- /dev/null +++ b/src/site/html/static/js/templates/avc/.gitrepo @@ -0,0 +1,12 @@ +; DO NOT EDIT (unless you know what you are doing) +; +; This subdirectory is a git "subrepo", and this file is maintained by the +; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme +; +[subrepo] + remote = /home/cloud/Code/pinski-plugins/avc + branch = master + commit = 257d397349f09eae1f5da27b78f4d93993ea5497 + parent = eb818bf63d0c8389c9997bf9735a75fec023c1c2 + method = merge + cmdver = 0.4.0 diff --git a/src/site/html/static/js/templates/avc/avc.js b/src/site/html/static/js/templates/avc/avc.js new file mode 100644 index 0000000..e74f433 --- /dev/null +++ b/src/site/html/static/js/templates/avc/avc.js @@ -0,0 +1,14 @@ +class AsyncValueCache { + constructor(fetchNow, callback) { + this.callback = callback + this.cachedPromise = null + if (fetchNow) this.fetch() + } + + fetch() { + if (this.cachedPromise) return this.cachedPromise + else return this.cachedPromise = this.callback() + } +} + +export {AsyncValueCache}