This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

11 lines
443 B
JavaScript

import { cond, block, defined, sub, set, proc } from '../base';
import AnimatedValue from '../core/InternalAnimatedValue';
const procDiff = proc(function (v, stash, prev) {
return block([set(stash, cond(defined(prev), sub(v, prev), 0)), set(prev, v), stash]);
});
export default function diff(v) {
const stash = new AnimatedValue(0);
const prev = new AnimatedValue();
return procDiff(v, stash, prev);
}
//# sourceMappingURL=diff.js.map