mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
cd9f6b53e7
commit
e1c5dbebd5
@ -89,6 +89,17 @@ var pwpath = require('../path')
|
||||
// -> <data>
|
||||
// -> <promise>
|
||||
//
|
||||
// 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 }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user