mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-22 16:31:52 +02:00
23 lines
531 B
JavaScript
23 lines
531 B
JavaScript
import {get, set} from "./schedule.js";
|
|
|
|
function durationFunction(id, value) {
|
|
return function() {
|
|
set(this, id).duration = +value.apply(this, arguments);
|
|
};
|
|
}
|
|
|
|
function durationConstant(id, value) {
|
|
return value = +value, function() {
|
|
set(this, id).duration = value;
|
|
};
|
|
}
|
|
|
|
export default function(value) {
|
|
var id = this._id;
|
|
|
|
return arguments.length
|
|
? this.each((typeof value === "function"
|
|
? durationFunction
|
|
: durationConstant)(id, value))
|
|
: get(this.node(), id).duration;
|
|
}
|