diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a9dd7..5daa69a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,3 +63,12 @@ - Bug fixes - Expose `isInvalidated` and `isRefetchEror` in result of `useQuery` and `useInfiniteQuery` + +## 1.5.0-beta.1 + +- Bug fix: retry count and retry delay parameters not working +- Bug fix: default values not working for retry count and retry delay +- New feature: `QueryClientBuilder` widget +- New feature: `QueryClient.removeQueries` method +- Bug fix: `QueryClient.setQueryData` to build new query if it doesn't exist +- Bug fixes: general diff --git a/README.md b/README.md index 3deaf28..3c84a05 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,11 @@ With this powerful tool at your disposal, managing server state (REST API, Graph ## Trusted & Used by -### UC San Diego - -![UC San Diego](https://github.com/41y08h/fquery/blob/main/media/ucsd-banner.png?raw=true) - -The University of California, San Diego has shifted to [fquery](https://github.com/41y08h/fquery/), _moving away from traditional state management solutions like provider, bloc, etc,_ as the backbone of their [mobile application](https://mobile.ucsd.edu/), which has over 30,000 users and serves as the app used by the generations of students. -With fquery's efficient and easy-to-use async state management, the developers are now enjoying the comfort of seamless state management by refactoring spaghetti blocks of codes, even files with 200 lines to just 20 lines. They also noticed a significant reduction of time in the hot reload. - -All of this is only to have more time, and an easy-to-manage structure to develop the features that matter the most. They are confident that the codebase will continue to be manageable, and provide the team with a better structure. - -### Stargazers and others - ![GitHub Repo stars](https://img.shields.io/github/stars/41y08h/fquery?style=social) The project's growth has almost been completely organic, it has grown popular in the developer community and is growing by the day, consider starring it if you've found it useful. -As a developer, you too can leverage the power of this tool to create a high-quality mobile application that provides an exceptional user experience. [fquery](https://github.com/41y08h/fquery/) is a reliable and efficient solution that has already been proven successful in UC San Diego's app. So, why not choose it for your next project and take advantage of its powerful features to deliver a seamless experience to your users? +As a developer, you too can leverage the power of this tool to create a high-quality mobile application that provides an exceptional user experience. So, why not choose it for your next project and take advantage of its powerful features to deliver a seamless experience to your users? ## 🌌 Features @@ -356,6 +345,30 @@ void main() { child: CupertinoApp( ``` +#### `QueryClient.removeQueries` + +This method is used to remove any query from the cache. If the query's data is currently being rendered on the screen then it will still show and the query will also be removed from the cache. + +### `QueryClientBuilder` widget + +There's also a builder widget where you can get access to the query client. + +```dart +QueryClientBuilder( + builder: (context, queryClient) { + return MutationBuilder( + (id) async { + await todosAPI.delete(todo.id); + return id; + }, + onSuccess: (id, _, ctx) { + queryClient.setQueryData>( + ['todos'], + (previous) { + if (previous == null) return []; + return previous.where((e) { +``` + ## Mutations Similar to queries, you can also use the `useMutation` hook to mutate data on the server or just anywhere, just return a `Future` in your mutation function and you're good to go. diff --git a/media/stargazers.mp4 b/media/stargazers.mp4 deleted file mode 100644 index 16c8417..0000000 Binary files a/media/stargazers.mp4 and /dev/null differ diff --git a/media/ucsd-banner.png b/media/ucsd-banner.png deleted file mode 100644 index a237956..0000000 Binary files a/media/ucsd-banner.png and /dev/null differ diff --git a/media/ucsd-white.png b/media/ucsd-white.png deleted file mode 100644 index ff86b0c..0000000 Binary files a/media/ucsd-white.png and /dev/null differ diff --git a/pubspec.yaml b/pubspec.yaml index 9e04a50..6791b38 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fquery description: fquery is a powerful async state management solution for Flutter. It caches, updates, and fully manages asynchronous data in your Flutter apps. -version: 1.4.0-beta.1 +version: 1.5.0-beta.1 repository: https://github.com/41y08h/fquery environment: