mirror of
https://github.com/flynx/features.js.git
synced 2025-10-29 18:30:11 +00:00
some tweaking and moving some responsibility back to actions.js...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
fbcf99b6cd
commit
7315e95d21
24
features.js
24
features.js
@ -11,7 +11,6 @@ var object = require('ig-object')
|
|||||||
var actions = module.actions = require('ig-actions')
|
var actions = module.actions = require('ig-actions')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
// XXX use object.Error as base when ready...
|
// XXX use object.Error as base when ready...
|
||||||
@ -161,19 +160,19 @@ object.Constructor('Feature', {
|
|||||||
// NOTE: this will only mixin functions and actions...
|
// NOTE: this will only mixin functions and actions...
|
||||||
if(this.actions != null){
|
if(this.actions != null){
|
||||||
this.tag ?
|
this.tag ?
|
||||||
actions.mixin(this.actions, {source_tag: this.tag})
|
// XXX HANDLERS
|
||||||
: actions.mixin(this.actions)
|
actions.mixin(this.actions, {source_tag: this.tag, action_handlers: true})
|
||||||
// XXX HANDLERS here we will also need to copy this.actions.__action_handlers into the mixin...
|
: actions.mixin(this.actions, {action_handlers: true}) }
|
||||||
//this.actions.__action_handlers
|
//actions.mixin(this.actions, {source_tag: this.tag})
|
||||||
// && actions.__proto__.__action_handlers = this.actions.__action_handlers
|
//: actions.mixin(this.actions) }
|
||||||
}
|
|
||||||
|
|
||||||
|
/*/ XXX HANDLERS this is not needed if handlers are local to actions...
|
||||||
// install handlers...
|
// install handlers...
|
||||||
if(this.handlers != null){
|
if(this.handlers != null){
|
||||||
this.handlers.forEach(function([a, h]){
|
this.handlers.forEach(function([a, h]){
|
||||||
// XXX HANDLERS this breaks into recursion...
|
|
||||||
//actions.__proto__.on(a, that.tag, h) }) }
|
//actions.__proto__.on(a, that.tag, h) }) }
|
||||||
actions.on(a, that.tag, h) }) }
|
actions.on(a, that.tag, h) }) }
|
||||||
|
//*/
|
||||||
|
|
||||||
// merge config...
|
// merge config...
|
||||||
// NOTE: this will merge the actual config in .config.__proto__
|
// NOTE: this will merge the actual config in .config.__proto__
|
||||||
@ -215,9 +214,10 @@ object.Constructor('Feature', {
|
|||||||
this.actions != null
|
this.actions != null
|
||||||
&& actions.mixout(this.tag || this.actions)
|
&& actions.mixout(this.tag || this.actions)
|
||||||
|
|
||||||
// XXX HANDLERS do we need this if .handlers if local to action...
|
/*/ XXX HANDLERS do we need this if .handlers if local to action...
|
||||||
this.handlers != null
|
this.handlers != null
|
||||||
&& actions.off('*', this.tag)
|
&& actions.off('*', this.tag)
|
||||||
|
//*/
|
||||||
|
|
||||||
// XXX
|
// XXX
|
||||||
this.hasOwnProperty('remove')
|
this.hasOwnProperty('remove')
|
||||||
@ -283,8 +283,9 @@ object.Constructor('Feature', {
|
|||||||
suggested: obj,
|
suggested: obj,
|
||||||
} }
|
} }
|
||||||
|
|
||||||
/*/ XXX HANDLERS setup .handlers...
|
// XXX HANDLERS setup .handlers...
|
||||||
if(obj.handlers && obj.actions){
|
if(obj.handlers){
|
||||||
|
obj.actions = obj.actions || {}
|
||||||
// NOTE: obj.actions does not have to be an action so w cheat \
|
// NOTE: obj.actions does not have to be an action so w cheat \
|
||||||
// a bit here, then copy the mindings...
|
// a bit here, then copy the mindings...
|
||||||
var tmp = Object.create(actions.MetaActions)
|
var tmp = Object.create(actions.MetaActions)
|
||||||
@ -292,7 +293,6 @@ object.Constructor('Feature', {
|
|||||||
.forEach(function([a, h]){
|
.forEach(function([a, h]){
|
||||||
tmp.on(a, obj.tag, h) })
|
tmp.on(a, obj.tag, h) })
|
||||||
Object.assign(obj.actions, tmp) }
|
Object.assign(obj.actions, tmp) }
|
||||||
//*/
|
|
||||||
|
|
||||||
// feature-set...
|
// feature-set...
|
||||||
if(feature_set){
|
if(feature_set){
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-features",
|
"name": "ig-features",
|
||||||
"version": "3.4.4",
|
"version": "3.4.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "features.js",
|
"main": "features.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/flynx/features.js#readme",
|
"homepage": "https://github.com/flynx/features.js#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ig-actions": "^3.24.13",
|
"ig-actions": "^3.24.28",
|
||||||
"ig-object": "^5.4.11"
|
"ig-object": "^5.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user