minor fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-09-02 00:12:08 +03:00
parent d3a457131c
commit 8905152126
4 changed files with 16 additions and 10 deletions

View File

@ -849,6 +849,11 @@ module.Cache = ImageGridFeatures.Feature({
// Create a debounced action...
//
// debounce(<func>)
// debounce(<timeout>, <func>)
// debounce(<options>, <func>)
// -> function
//
// options format:
// {
// timeout: number,
@ -860,8 +865,9 @@ var debounce =
module.debounce =
function(options, func){
// parse args...
func = options instanceof Function ? options : func
options = options instanceof Function ? {} : options
var args = [...arguments]
func = args.pop()
options = args.pop() || {}
if(typeof(options) == typeof(123)){
options.timeout = options
@ -903,7 +909,8 @@ function(options, func){
}
f.toString = function(){
return `// debounced...\n${doc([func.toString()])}`
return `// debounced...\n${
doc([ func instanceof Function ? func.toString() : func ])}`
}
return f

View File

@ -59,9 +59,8 @@ var ExampleActions = actions.Actions({
console.log(' <', args)
return args
})],
testDebounce: ['Test/',
core.debounce(1000, 'exampleAction: ... -- docs...')],
exampleAliasDebounced: ['Test/',
core.debounce(1000, 'exampleAction: ...')],
// a normal method...
exampleMethod: function(){

View File

@ -1141,9 +1141,9 @@
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"ig-actions": {
"version": "3.20.1",
"resolved": "https://registry.npmjs.org/ig-actions/-/ig-actions-3.20.1.tgz",
"integrity": "sha512-eLQBRwHE+XSkYBbxH15cDIzPbVX8mMoyROyLe9HsEQCiX4bCAsyHRI+Gh6i3f30PyI4evTxHPSI+WiGZXXZGMA==",
"version": "3.20.2",
"resolved": "https://registry.npmjs.org/ig-actions/-/ig-actions-3.20.2.tgz",
"integrity": "sha512-B6tyFOgtg+9Pks8rtq0BgnDsU2kUbRm56/fCEOTeozCanl9Lm7atiKFa5ZonglzDdMLZpiXffLYW0vbYVgy9zw==",
"requires": {
"ig-object": "^1.0.7"
}

View File

@ -26,7 +26,7 @@
"fs-walk": "^0.0.1",
"glob": "^4.0.6",
"guarantee-events": "^1.0.0",
"ig-actions": "^3.20.1",
"ig-actions": "^3.20.2",
"ig-features": "^3.3.4",
"ig-object": "^1.0.7",
"moment": "^2.22.2",