1.0.4 • Published 2 years ago

@ce1pers/use-image v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@ce1pers/use-image

React hook to getting image file in device.

Installation

npm

npm i @ce1pers/use-image

yarn

yarn add @ce1pers/use-image

Usage

// Import hook.
import useImage, { GRANTED, DENIED, NEVER_ASK_AGAIN } from "@ce1pers/use-image";

...

// Make any event handler(function).
const handleAnyButtonClick = async () => {
  const isGranted = await checkPermission();
  if (isGranted === GRANTED) {
    const asset = await selectImage();
    // Do something you want.
  } else {
    // Open app's info/setting (Optional).
    openSetting();
  }
};

...
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago