Skip to content

Commit

Permalink
docs: fix flat args ordering (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppeeou authored Apr 14, 2024
1 parent 3f86e1b commit 59e6a87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Lazy/flat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function async<A>(

/**
* Returns flattened Iterable/AsyncIterable.
* If first argument is number, more perform flatten `flat(2, [[[1,2]]]) // [1,2]`
* If first argument is number, more perform flatten `flat([[[1,2]]], 2) // [1,2]`
*
* @example
* ```ts
Expand Down
14 changes: 12 additions & 2 deletions src/Lazy/fx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ class FxAsyncIterable<A> {

/**
* Returns flattened AsyncIterable.
* If first argument is number, more perform flatten `flat(2, [[[1,2]]]) // [1,2]`
* If first argument is number, more perform flatten
*
* @example
* ```
* await fx([[1],[[2]]])
* .toAsync()
* .flat(2).toArray(); // [1,2]
* ```
*
* see {@link https://fxts.dev/docs/flat | flat}
*/
Expand Down Expand Up @@ -312,7 +319,10 @@ export class FxIterable<A> {

/**
* Returns flattened Iterable.
* If first argument is number, more perform flatten `flat(2, [[[1,2]]]) // [1,2]`
* If first argument is number, more perform flatten
*
* @example
* `fx([[1],[[2]]]).flat(2).toArray(); // [1,2]`
*
* see {@link https://fxts.dev/docs/flat | flat}
*/
Expand Down

0 comments on commit 59e6a87

Please sign in to comment.