0.0.1 • Published 5 years ago

@rnhooks/camera-roll v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@rnhooks/camera-roll Build Status Maintainability

React Native hook for Camera Roll

Installation

yarn add @rnhooks/camera-roll

Usage

import useCameraRoll from '@rnhooks/camera-roll';

function App() {
  const [photos, getPhotos, saveToCameraRoll, error] = useCameraRoll();

  return (
    <View style={styles.container}>
      <Text style={styles.welcome}>@rnhooks/camera-roll</Text>
      <Button title="Get Photos" onPress={getPhotos} />
    </View>
  );
}

Output

NameDefaultTypeDescription
photosDefaultsobjectPhotos Object
getPhotos(params) => {}functionGet Photos Function
saveToCameraRoll() => {}functionSave to Camera Roll Function
errorundefinedstringError string

Defaults

const initialState = {
  edges: [],
  page_info: {
    has_next_page: false,
    start_cursor: '',
    end_cursor: '',
  },
};