ate);

				const { start, duration } = this.get();
				const elapsed = window.performance.now() - start;

				if (elapsed > duration) return;

				this.set({ elapsed });
			};

			update();
		},

		ondestroy() {
			if (this.frame) {
				cancelAnimationFrame(this.frame);
			}
		},

		methods: {
			reset() {
				this.set({
					start: window.performance.now()
				});
			}
		}
	};
</script>