docs and notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-11-05 01:05:40 +03:00
parent d1c3a8c65a
commit 33ee63cafa
2 changed files with 25 additions and 10 deletions

View File

@ -21,10 +21,23 @@ var ExampleActions = actions.Actions({
// XXX stuff for togglers... // XXX stuff for togglers...
}, },
// NOTE: the path / short doc is optional but it is not recommended
// to to omit it unless defining a non-root action...
// XXX should an action be able to overload the doc???
// ...the intuitive thing to do here is make the doc "write-once"
// i.e. once defined it can't be overwritten...
exampleAction: ['- Test/', exampleAction: ['- Test/',
function(){ function(){
// XXX // XXX
}], }],
exampleActionFull: ['- Test/',
core.doc`Example full action long documentation string
`,
// action attributes...
{},
function(){
// XXX
}],
// a normal method... // a normal method...
exampleMethod: function(){ exampleMethod: function(){
@ -43,7 +56,7 @@ var ExampleActions = actions.Actions({
// promise handling... // promise handling...
// //
// also see corresponding WidgetTest.handlers // also see corresponding Example.handlers
exampleSyncAction: ['- Test/', exampleSyncAction: ['- Test/',
//{await: true}, //{await: true},
function(t){ function(t){
@ -59,6 +72,7 @@ var ExampleActions = actions.Actions({
// Togglers... // Togglers...
// //
// XXX ...
exampleToggler: ['- Test/', exampleToggler: ['- Test/',
function(){ function(){
}], }],
@ -129,15 +143,22 @@ module.Example = core.ImageGridFeatures.Feature({
title: '', title: '',
doc: '', doc: '',
// XXX
tag: 'action-examples', tag: 'action-examples',
depends: [ depends: [
// XXX
], ],
actions: ExampleActions, actions: ExampleActions,
handlers: [], // XXX make this not applicable in production...
handlers: [
['exampleAsyncAction.pre exampleSyncAction.pre',
function(){
console.log('PRE')
return function(){
console.log('POST') }
}],
],
}) })

View File

@ -2655,12 +2655,6 @@ module.WidgetTest = core.ImageGridFeatures.Feature({
actions: WidgetTestActions, actions: WidgetTestActions,
handlers: [ handlers: [
['asyncAction.pre syncAction.pre',
function(){
console.log('PRE')
return function(){
console.log('POST') }
}],
], ],
}) })