Skip to content

v2.0.0

Compare
Choose a tag to compare
@chrisbianca chrisbianca released this 21 May 07:54
· 274 commits to master since this release

Release Notes

Breaking Changes

  • All hooks now return an array rather than an object to enable easier composition of hooks. The structure of this array is generally:
const [value, loading, error] = useHook();
  • Any hooks with optional parameters now have a single options object parameter which contains all optional parameters:
    • Firestore:

      • useCollection(query, options) is now useCollection(query, { snapshotListenOptions })
      • useCollectionOnce(query, options) is now useCollectionOnce(query, { getOptions })
      • useCollectionData(query, options, idField) is now useCollectionData(query, { idField, snapshotListenOptions })
      • useCollectionDataOnce(query, options, idField) is now useCollectionDataOnce(query, { getOptions, idField })
      • useDocument(ref, options) is now useDocument(ref, { snapshotListenOptions })
      • useDocumentOnce(ref, options) is now useDocumentOnce(ref, { getOptions })
      • useDocumentData(ref, options, idField) is now useDocumentData(ref, { idField, snapshotListenOptions })
      • useDocumentDataOnce(ref, options, idField) is now useDocumentDataOnce(ref, { getOptions, idField })
    • Database:

      • useListVals<T>(ref, keyField) is now useListVals<T>(ref, { keyField })
      • useObjectVal<T>(ref, keyField) is now useObjectVal<T>(ref, { keyField })
  • Auth hooks now return firebase.auth.Error rather than firebase.FirebaseError as this is what the auth methods return from the SDK
  • Firestore hooks now return Error rather than firebase.FirebaseError as this is what the firestore methods return from the SDK

New Features

  • Overhauled documentation to make it easier to read
  • Reworked behind the scenes to better re-use code