Skip to content

Commit

Permalink
doc: add PartialX to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Dec 9, 2022
1 parent 510d0ff commit 470adbe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

@samber: I sometimes forget to update this file. Ping me on [Twitter](https://twitter.com/samuelberthe) or open an issue in case of error. We need to keep a clear changelog for easier lib upgrade.

## 1.37.0 (2022-12-xx)

Adding:
- lo.PartialX

## 1.36.0 (2022-11-28)

Adding:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -226,6 +226,7 @@ Type manipulation helpers:
Function helpers:

- [Partial](#partial)
- [Partial2 -> Partial5](#partial2---partial5)

Concurrency helpers:

Expand Down Expand Up @@ -2274,6 +2275,21 @@ f(42)
// 47
```

### Partial2 -> Partial5

Returns new function that, when called, has its first argument set to the provided value.

```go
add := func(x, y, z int) int { return x + y + z }
f := lo.Partial2(add, 42)

f(10, 5)
// 57

f(42, -4)
// 80
```

### Attempt

Invokes a function N times until it returns valid output. Returning either the caught error or nil. When first argument is less than `1`, the function runs until a successful response is returned.
Expand Down

0 comments on commit 470adbe

Please sign in to comment.