From e1c5dbebd5ecf81c00baa74459f34979e0cc8ea0 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 22 Oct 2022 15:22:19 +0300 Subject: [PATCH] docs... Signed-off-by: Alex A. Naanou --- pwiki/store/base.js | 16 ++++++++++++---- pwiki2.js | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pwiki/store/base.js b/pwiki/store/base.js index 932fb67..f4c92cd 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -89,6 +89,17 @@ var pwpath = require('../path') // -> // -> // +// NOTE: the main differences between the 'get', 'lazy' and 'cached' actions: +// 'get' +// generate/merge are all sync/async as defined +// when cached value available validate and return either the cached value or generate +// 'lazy' +// XXX +// 'cached' +// call get in background +// return cached value or undefined +// +// // // Special methods: // @@ -238,22 +249,19 @@ function(name, generate, options={}){ && res instanceof Promise) ? this[cache] : res } - // action: cached... if(action == 'cached'){ _deferred(this, 'get') return this[cache] } - // action: local... - // NOTE: this "cascade" of actions is interdependent... // NOTE: this is intentionally not cached... if(action == 'local'){ return _make(this) } + // action: clear/reset... if(action == 'clear' || action == 'reset'){ delete this[cache] } - // action: clear... if(action == 'clear'){ return } diff --git a/pwiki2.js b/pwiki2.js index 3c52d86..7f20159 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -17,7 +17,8 @@ * - CLI * * -* XXX add 'status' action to .index(..) and makeIndex(..) +* XXX ASAP move index stuff to pwiki/index.js +* XXX can index validation be async??? * XXX INDEX / CACHE: * - centralized * - nestable