I need to store the pointer X position in a variable. According popmotion documentation (See link here) the following would do the trick:
import { pointer } from 'popmotion';
pointer().start(({ x }) => console.log(x));
in fact, by using the code above the exact value of x is shown in the console, but I am having troubles in using the value in my code.
I have already tried:
const X = pointer().start(({ x }) => x);
const X = pointer().start(({ x }) => { return x; });
but console.log(X) returns {stop: ƒ}
I am not very familiar with arrow functions and I appreciate any help, thanks