mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
24 lines
513 B
JavaScript
24 lines
513 B
JavaScript
import {get, init} from "./schedule.js";
|
|
|
|
function delayFunction(id, value) {
|
|
return function() {
|
|
init(this, id).delay = +value.apply(this, arguments);
|
|
};
|
|
}
|
|
|
|
function delayConstant(id, value) {
|
|
return value = +value, function() {
|
|
init(this, id).delay = value;
|
|
};
|
|
}
|
|
|
|
export default function(value) {
|
|
var id = this._id;
|
|
|
|
return arguments.length
|
|
? this.each((typeof value === "function"
|
|
? delayFunction
|
|
: delayConstant)(id, value))
|
|
: get(this.node(), id).delay;
|
|
}
|