1.2.0 • Published 3 years ago

@ithreat/use-query v1.2.0

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

@ithreat/use-query

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save @ithreat/use-query

Usage

import React, { useContext } from 'react'
import {StitchContext} from '@ithreat/stitch-provider';
import {ToastContext} from '@ithreat/toast-provider';
import {useQuery} from '@ithreat/use-query';

const App = () => {
  const {db} = useContext(StitchContext);
  const {toast} = useContext(ToastContext);
     const queryHook = useQuery({
        collection: 'collection-name',
        baseQuery: {owner: 'company-name'},
        defaultSortField: 'field-name',
        defaultSortOrder: -1,
        defaultPageSize: 50,
        db,
        toast,
    });

  return (
    <div>
      Hook for saving query state and running queries.  Works well with @ithreat/use-results hook.
    </div>
  )

};

export default App;

License

MIT © djm-ithreat