tweaks and cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-03 01:52:01 +03:00
parent 0da4026b27
commit 30140f0918
2 changed files with 8 additions and 13 deletions

View File

@ -1,7 +1,6 @@
/********************************************************************** /**********************************************************************
* *
* *
*
* Architecture: * Architecture:
* store * store
* page * page
@ -18,12 +17,15 @@
* *
* *
* TODO: * TODO:
* - .load(..) / .json(..) -- for most stores...
* might be a good idea to keep a unified format...
* - <page>.then() -- resolve when all pending write operations done ??? * - <page>.then() -- resolve when all pending write operations done ???
* - an async REPL??? * - an async REPL???
* *
* *
* XXX BUG: .get('/* /path').raw will return a punch of '/*' copies, should
* be the same as .get('/*').match()...
* (NOTE: the " " in the pattern is to avoid closing the block comment)
*
*
* *
*********************************************************************** ***********************************************************************
* *
@ -77,10 +79,6 @@ var pouchdbstore = require('./store/pouchdb')
//---------------------------------------------------------------------
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Page... // Page...
@ -1732,14 +1730,11 @@ store.next.load(
store.update('@file', store.update('@file',
Object.create(filestore.FileStore)) Object.create(filestore.FileStore))
// XXX writing to pages in here does not work yet...
// p.pwiki.path = '/@pouch/README'
// p.pwiki.text = 'PouchDB Store'
store.update('@pouch', store.update('@pouch',
Object.assign( Object.assign(
Object.create(pouchdbstore.PouchDBStore), Object.create(pouchdbstore.PouchDBStore),
{ {
__name__: 'data/pouch', __path__: 'data/pouch',
})) }))

View File

@ -26,7 +26,7 @@ module.PouchDBStore = {
// XXX should this be __path__??? // XXX should this be __path__???
// ...this sets the path where the store is created... // ...this sets the path where the store is created...
__name__: 'data/pouch', __path__: 'data/pouch',
__key_prefix__: 'pwiki:', __key_prefix__: 'pwiki:',
__data: undefined, __data: undefined,
@ -35,7 +35,7 @@ module.PouchDBStore = {
var PouchDB = var PouchDB =
module.PouchDB = module.PouchDB =
require('PouchDB') require('PouchDB')
return (this.__data = new PouchDB(this.__name__)) } return (this.__data = new PouchDB(this.__path__)) }
return this.__data }, return this.__data },
set data(value){ set data(value){
this.__data = value }, this.__data = value },