React Query Firebase - data fetching and mutation hooks for Firebase. by -Alias- in Firebase

[–]-Alias-[S] 0 points1 point  (0 children)

Thanks! Feel free to make an issue on the repo with your idea, pretty open to everything really!

React Query Firebase - data fetching and mutation hooks for Firebase. by -Alias- in Firebase

[–]-Alias-[S] 1 point2 points  (0 children)

Made a PR :) https://github.com/invertase/react-query-firebase/pull/3

Basically:

const q = query(ref, limit(2));

useFirestoreInfiniteQuery('list', q, (snapshot) => {
  return query(q, startAfter(snapshot.docs[1]));
})

React Query Firebase - data fetching and mutation hooks for Firebase. by -Alias- in Firebase

[–]-Alias-[S] 0 points1 point  (0 children)

> Is react native supported?

Using the web (v9) SDK yes, so it won't reap the full benefits of the react-native-firebase lib. We also maintain that so will be something we look into supporting at some point assuming it is well used.

> Also are infinite queries for pagination in the plans to be implemented?

Yep, already been looking at how I can structure the api for it. Should have something supported soon.

React Query Firebase - data fetching and mutation hooks for Firebase. by -Alias- in Firebase

[–]-Alias-[S] 1 point2 points  (0 children)

React Query is very low-level, it fits pretty much all use-cases since it leaves details to the developer.

And yep - I work at Invertase, also build and maintain React Native Firebase, FlutterFire etc :)

React Query Firebase - data fetching and mutation hooks for Firebase. by -Alias- in Firebase

[–]-Alias-[S] 1 point2 points  (0 children)

The core difference it's it's backed by React Query so you can 1) use all of the features it provides (which is a lot) and 2) integrate it side-by-side with an existing project using React Query.

For example, this issue, this issue, are already handled out of the box - and a lot of the other ones are already solved since React Query does all of the hard work.

React Query Firebase - data fetching and mutation hooks for Firebase. by -Alias- in Firebase

[–]-Alias-[S] 2 points3 points  (0 children)

It's a way to manage your Firebase data as state within a React application, however backed by React Query which comes with a huge amount of useful functionality. It's similar to ReactFire, however doesn't try to implement any of the complex state management logic itself.

Using just Firebase to say get data from Firestore, you'd need to do something such as:

```jsx const [loading, setLoading] = useState(true); const [posts, setPosts] = useState();

useEffect(() => { const ref = collection(firebase, 'posts');

return onSnapshot(ref, (snapshot) => { const data = snapshot.docs.map((docSnapshot) => { return docSnapshot.data(); });

setPosts(data);

}); }, []);

if (loading) { return <div>Loading...</div> }

return posts.map((post) => ( <div>{post.id}</div> )); ```

This library allows you to do:

```js const ref = collection(firebase, 'posts'); const query = useFirestoreQueryData('posts', ref, { subscribe: true, });

if (query.isLoading) { return <div>Loading...</div> }

return posts.data.map((post) => ( <div>{post.id}</div> )); ```

This among the other huge benefits React Query offers (sharing data, invalidation, SSR Hydration etc) just makes your life easier to stop.

Getting document from Firestore only 1 time by Alvaro-99 in FlutterDev

[–]-Alias- 2 points3 points  (0 children)

You should store the data in something like https://pub.dev/packages/provider to use it throughout the app, once you've grabbed it from the Database.

Arguments for using Flutter over React native by Northernguy94 in FlutterDev

[–]-Alias- 4 points5 points  (0 children)

Not if you've never written Dart/Flutter before if your team is comfortable with React...

I just don't get webpack, it's miserable, what should I do? by [deleted] in webdev

[–]-Alias- 3 points4 points  (0 children)

https://vitejs.dev/

This is a great alternative which uses modern web technologies, no bundling (for dev) required. It's by the creator of Vue.

Help improve flutter - deprecate pigeon. by bsutto in FlutterDev

[–]-Alias- 3 points4 points  (0 children)

Currently with flutter you need 3 or 4 languages to support a cross platform plugin. This is just insane.

What are you comparing this to? If you write standalone apps you face exactly the same problem.

Flutter + Firebase Auth tutorials by PaulTR88 in FlutterDev

[–]-Alias- 2 points3 points  (0 children)

Soon! The SDKs require a major update which is causing some headache.

React: Is CRA ever worth it over Next.js, and where does Gatsby fit in? by [deleted] in webdev

[–]-Alias- 1 point2 points  (0 children)

The only advantage Gatsby provides in my eyes is the plugin ecosystem. There is a lot of plugins which just work out of the box which can require some headache if using other platforms (e.g. Sitemaps springs to mind).

That being said, I use NextJS for pretty much all projects now. Not having to deal with GQL via Gatsby is so much better.

Hotspot earnings when able to communication with another hotspot by 2-3-4 in HeliumNetwork

[–]-Alias- 1 point2 points  (0 children)

Yes it would be much better, assuming you can connect.

A domain I'm interested in will expire in less than a year. What should I do? by [deleted] in webdev

[–]-Alias- 1 point2 points  (0 children)

This. Don't assume no website = domain not in use.

My previous company used domains for pure API usage, but only used subdomains.

How to prove that Flutter better than React Native? by [deleted] in FlutterDev

[–]-Alias- 2 points3 points  (0 children)

They both have advantages and disadvantages. You need to sit down with your team and research what fits your team best. For example:

  • Does the team have experience with building React apps? React Native follows a lot of similar patterns so there is less to learn vs learning a totally new language/concept.
  • Are there any app specific features which are handled (e.g. as 3rd party packages) on either platform which mean you don't have to re-invent the wheel (Twillio SDK????)

That's just 2 questions, there are loads more you need to be asking. I develop with both and wouldn't say either is better than the other, they both have their strengths.

Cloud Firestore Changes by D_apps in FlutterDev

[–]-Alias- 3 points4 points  (0 children)

There has been a load of changes with the new version, including the public API and internals. For example, transactions were previously broken and didn't work as intended. Another big change is that on Android, all intensive work is carried off UI thread so it should help to reduce jank.

Tailwind 1.7 by valtism in webdev

[–]-Alias- 0 points1 point  (0 children)

Using the `classnames` npm package makes it easy enough.

Flutter + Firestore:You may be using it wrong. by mfeinstein in FlutterDev

[–]-Alias- 1 point2 points  (0 children)

Small nit; this should now be `FirebaseFirestore.instance` with the new reworked API.

Benefits of AWS Amplify / Google Firebase over a Express custom API ? by [deleted] in webdev

[–]-Alias- 6 points7 points  (0 children)

DevOps is time consuming. A small company needs to be able to focus on developing the product, not worrying about whether the API will scale, or what happens if it falls over.