Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcparkyn committed May 4, 2024
1 parent 1247081 commit 1651a0c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Currently, Phetch is only designed for use with Blazor WebAssembly. However, the
- Automatically handles loading and error states, and updates your components whenever the state changes.
- Automatically caches data returned by queries, and makes it easy to invalidate or update this cached data when needed.
- Supports calling any async method as a query (not restricted just to HTTP requests).
- Supports dependent queries, pagination, prefetching, request de-duplication, retries, CancellationTokens, and more.
- Supports pagination, prefetching, request de-duplication, retries, dependent queries, CancellationTokens, and more.
- 100% strongly typed, with nullability annotations.
- Lightweight and easy to mix-and-match with other state management methods.
- Lightweight and easy to combine with other state management methods.
- No Javascript needed!

## Show me some code!
Expand Down Expand Up @@ -57,12 +57,19 @@ var isEvenEndpoint = new Endpoint<int, bool>(
</UseEndpoint>
```

Some notes on the example above:
<details>
<summary>Some notes on the example above</summary>

- Inside the `<UseEndpoint>` component, you can use `query` to access the current state of the query. Changing the `Context` parameter will rename this object.
- By changing the `Arg` parameter, the query will automatically be re-fetched when needed.
- Normally, you would share endpoints around your application using dependency injection (see [Defining Query Endpoints](#defining-query-endpoints-recommended)).
- If you need to access the query state inside the `@code` block of a component, you can replace `<UseEndpoint/>` with the pattern described in [Using Query Objects Directly](#using-query-objects-directly).

</details>
</br>

[Click here to go to the full documentation](https://jcparkyn.github.io/phetch/docs/getting-started.html)

## Installing

You can install Phetch via the .NET CLI with the following command:
Expand Down

0 comments on commit 1651a0c

Please sign in to comment.