working on functions as page values...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-04-23 11:07:30 +03:00
parent 76f322a482
commit cf92d0af8d

View File

@ -295,7 +295,8 @@ function(name){
module.path.relative(this.location, path),
...args) } }
// XXX do we need history management???
// XXX HISTORY do we need history management???
// XXX FUNC need to handle functions in store...
var BasePage =
module.BasePage =
object.Constructor('BasePage', {
@ -363,17 +364,21 @@ object.Constructor('BasePage', {
// page data...
//
// XXX handle functions as pages...
// XXX FUNC handle functions as pages...
// XXX need to support pattern pages...
get data(){
return this.store.get(this.location) },
// XXX need to support pattern pages...
set data(value){
this.store.update(this.location, value) },
// shorthands...
// XXX FUNC handle functions as pages...
// XXX need to support pattern pages...
get text(){
return this.data.text },
// XXX need to support pattern pages...
var data = this.data
return data instanceof Function ?
// XXX FUNC not sure about this...
data.call(this, 'text')
: data.text },
set text(value){
this.store.update(this.location, {text: value}) },