Skip to content

Commit

Permalink
fix signature for whenXX functions
Browse files Browse the repository at this point in the history
The signature for when function is when(condition, fn, []), and the signature for whenXX functions should be just when(fn, [])
  • Loading branch information
liao02x authored Nov 10, 2022
1 parent 046dd50 commit c64f10a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/docs/configuration/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ module.exports = {

If `condition` evaluates to true, `fn` is called and the helper will return what that function returns. If false, `unmetValue` will be returned (or `undefined` if not provided).

#### `whenDev(condition, fn, [unmetValue])`
#### `whenDev(fn, [unmetValue])`

`whenDev<T>(fn: () => T, unmetValue?: T): T | undefined`

Equivalent to `when(process.env.NODE_ENV === 'development', fn, unmetValue)`.

#### `whenProd(condition, fn, [unmetValue])`
#### `whenProd(fn, [unmetValue])`

`whenProd<T>(fn: () => T, unmetValue?: T): T | undefined`

Equivalent to `when(process.env.NODE_ENV === 'production', fn, unmetValue)`.

#### `whenTest(condition, fn, [unmetValue])`
#### `whenTest(fn, [unmetValue])`

`whenTest<T>(fn: () => T, unmetValue?: T): T | undefined`

Expand Down

0 comments on commit c64f10a

Please sign in to comment.