0.2.0 • Published 4 years ago

hally9k-apollo-hooks-extended v0.2.0

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

Apollo Hooks Extended

Build Status Coverage Status NPM version MIT License

Let's start with big kudos for the authors and maintainers of Apollo, fantastic work :)

This package is a complementary library providing additional features for @apollo/client.

Installation

Using Yarn:

$ yarn add apollo-hooks-extended

# or
$ yarn add apollo-hooks-extended

Using Npm:

$ npm install apollo-hooks-extended

# or
$ npm i apollo-hooks-extended

Features

Resettable Hook

It is not currently possible to reset the state returned by the useMutation hook.

useResettableMutation is a swap in replacement which wraps useMutation and provides a reset function.

import {useResettableMutation} from 'apollo-hooks-extended';
// ...
const [performMutation, {data, loading, error, reset}] = useResettableMutation(query);