npm install interpolation-buffer
import { InterpolationBuffer } from "interpolation-buffer";
// initialize
const stateBuffer = new InterpolationBuffer(state, 50, lerp);
// enqueue
stateBuffer.enqueue(state, [], timestamp);
// fetch
const { state } = this.stateBuffer.getInterpolatedState(Date.now());