Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in README.md #1

Merged
merged 1 commit into from
May 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**RequireKTX** is a collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android, using the same idea as [`requireContext`](https://developer.android.com/reference/androidx/fragment/app/Fragment.html#requireContext()), [`requireArguments`](https://developer.android.com/reference/androidx/fragment/app/Fragment.html#requireArguments()), and other similar Android SDK methods.

For example, take the example of grabbing a Fragment argument bundle and reading a String ID from it that should always be there: you have two choices, and none of them are great:
Take the example of grabbing a Fragment argument bundle and reading a String ID from it that should always be there: you have two choices, and none of them are great:

```kotlin
// Nullable return type, have to do null handling
Expand All @@ -24,7 +24,7 @@ These methods in the library will throw an `IllegalArgumentException` if the key

---

To make the nullable case more obvious and explicit, RequireKTX also include `getOrNull` style methods for everything that it covers with `require` style methods. These match the conventions of the Kotlin standard library, and can make it easier to express that you want to get a `null` value if a value for a key couldn't be fetched (doesn't exist, or is the wrong type).
To make the nullable case more obvious and explicit, RequireKTX also includes `getOrNull` style methods for everything that it covers with `require` style methods. These match the conventions of the Kotlin standard library, and can make it easier to express that you want to get a `null` value if a value for a key couldn't be fetched (doesn't exist, or is the wrong type).

```kotlin
val userId: String? = requireArguments().getStringOrNull(ARG_USERID_KEY)
Expand Down