main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
909 bytes
|
Rev | Line | |
---|
[d565449] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | var tslib_1 = require("tslib");
|
---|
| 4 | var ts_easing_1 = require("ts-easing");
|
---|
| 5 | var useRaf_1 = tslib_1.__importDefault(require("./useRaf"));
|
---|
| 6 | var useTween = function (easingName, ms, delay) {
|
---|
| 7 | if (easingName === void 0) { easingName = 'inCirc'; }
|
---|
| 8 | if (ms === void 0) { ms = 200; }
|
---|
| 9 | if (delay === void 0) { delay = 0; }
|
---|
| 10 | var fn = ts_easing_1.easing[easingName];
|
---|
| 11 | var t = useRaf_1.default(ms, delay);
|
---|
| 12 | if (process.env.NODE_ENV !== 'production') {
|
---|
| 13 | if (typeof fn !== 'function') {
|
---|
| 14 | console.error('useTween() expected "easingName" property to be a valid easing function name, like:' +
|
---|
| 15 | '"' +
|
---|
| 16 | Object.keys(ts_easing_1.easing).join('", "') +
|
---|
| 17 | '".');
|
---|
| 18 | console.trace();
|
---|
| 19 | return 0;
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 | return fn(t);
|
---|
| 23 | };
|
---|
| 24 | exports.default = useTween;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.