Commit 05157af
committed
fix(ts): reorder generic parameters of IProduce
This makes the different call signatures of `produce` have a similar order of generic parameters when possible.
Before:
produce<Base, [number, string]>((draft, num, str) => {}) // no default
produce<Base, Draft<Base>, [number, string]>((draft, num, str) => {},
defaultValue)
After:
produce<Base, [number, string]>((draft, num, str) => {}) // no default
produce<Base, [number, string]>((draft, num, str) => {}, defaultValue)
As you can see, the draft type is no longer the 2nd generic parameter of
curried producers with a default value, which is just like the call
signature for curried producers without a default value.
This also moves the `D` generic parameter of `produce(base, recipe)` to
the end, so you can specify the `Return` parameter easier.1 parent ee8aac0 commit 05157af
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
0 commit comments