Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 427 Bytes

useMotion.md

File metadata and controls

23 lines (17 loc) · 427 Bytes

useMotion

Vue sensor hook that uses device's acceleration sensor to track its motions.

Usage

import {useMotion} from 'vue-next-use';

const Demo = () => {
  const [state, requestPermission] = useMotion();

  return () => (
      <div>
          <button onClick={requestPermission}>Get Permision</button>
          <pre>
              {JSON.stringify(state, null, 2)}
          </pre>
      </div>
  );
};