cleanup + notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-09-09 19:23:08 +03:00
parent 4929905460
commit e837b87663
2 changed files with 6 additions and 26 deletions

View File

@ -1383,21 +1383,13 @@ object.Constructor('Page', BasePage, {
// actions...
//
// XXX revise name...
// XXX NOEXPANDACTION
asPages: async function*(path='.:$ARGS', strict=false){
/*/
asPages: async function*(path='.:$ARGS', strict=false, noexpandactions=false){
//*/
// options...
var args = [...arguments]
var opts = typeof(args.at(-1)) == 'object' ?
args.pop()
: {}
// XXX NOEXPANDACTION
var {path, strict} = {
/*/
var {path, strict, noexpandactions} = {
//*/
...opts,
path: typeof(args[0]) == 'string' ?
args.shift()
@ -1412,7 +1404,6 @@ object.Constructor('Page', BasePage, {
yield* page
// handle lists in pages (actions, ... etc.)...
} else {
// XXX NOEXPANDACTION
var data = await page.data
data = typeof(data) == 'function' ?
data
@ -1427,21 +1418,6 @@ object.Constructor('Page', BasePage, {
return }
yield page } },
/*/
if(noexpandactions
&& await page.type == 'action'){
//yield this.get(this.QUOTE_ACTION_PAGE)
yield page
return }
var raw = await page.raw
if(raw == null){
return }
yield* raw instanceof Array ?
raw
.map(function(p){
return page.virtual({text: p}) })
: [page] } },
//*/
// expanded page text...
//

View File

@ -1,9 +1,13 @@
/**********************************************************************
*
*
* XXX add support for generator actions...
* XXX BUG CHROME: can't .get(..) a generator...
* https://bugs.chromium.org/p/chromium/issues/detail?id=1361981
* https://bugs.chromium.org/p/chromium/issues/detail?id=1361981
* when done test:
* .get('/test/list/generator').asPages()
* .get('/test/list/generator').raw
* .get('/test/list/generator').data
* .get('/test/list/generator').text
* XXX CACHE need to explicitly prevent caching of some actions/pages...
* XXX FEATURE tags and accompanying API...
* - add tags to page -- macro/filter