Skip to content
Myr

Pulled flow types from master with proper fix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Michel Weststrate · committed by Michel Weststrate · parent 8a572a4 · Browse files · 1 file+14 added−27 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−27 removed

  • other:+14 added−27 removed

1 file+14 added−27 removed

modified:src/immer.js.flow+14 added-27 removed
10 unmodified lines
11 * @param currentState - the state to start with12 * @param thunk - function that receives a proxy of the current state as first argument and which can be freely modified13 * @returns The next state: a new state, or the current state if nothing was modified14 */15declare function produce <S>(16 recipe: (draftState: S, ...extraArgs: any[]) => void17): (currentState: S, ...extraArgs: any[]) => S;18declare function produce <S>(15declare export default function produce<S>(16 currentState: S,17 recipe: (draftState: S) => void21) : S;22function produce() {2324}2526declare export default produce2728// declare export function default <S>(29// recipe: (draftState: S, ...extraArgs: any[]) => void30// )=> (currentState: S, ...extraArgs: any[]) => S31// declare export function default <S>(32// currentState: S,33// recipe: (draftState: S) => void34// ) => S18): S19// curried invocations36// declare export default <S, A, B, C>(37// recipe: (draftState: S, a: A, b: B, c: C) => void38// )=> (currentState: S, a: A, b: B, c: C) => S39// declare export default <S, A, B>(40// recipe: (draftState: S, a: A, b: B) => void41// )=> (currentState: S, a: A, b: B) => S42// declare export default <S, A>(43// recipe: (draftState: S, a: A) => void44// )=> (currentState: S) => S20declare export default function produce<S, A, B, C>(21 recipe: (draftState: S, a: A, b: B, c: C) => void22): (currentState: S, a: A, b: B, c: C) => S23declare export default function produce<S, A, B>(24 recipe: (draftState: S, a: A, b: B) => void25): (currentState: S, a: A, b: B) => S26declare export default function produce<S, A>(27 recipe: (draftState: S, a: A) => void28): (currentState: S) => S29declare export default function produce<S>(30 recipe: (draftState: S, ...extraArgs: any[]) => void31): (currentState: S, ...extraArgs: any[]) => S3233/**34 * Automatically freezes any state trees generated by immer.35 * This protects against accidental modifications of the state tree outside of an immer function.
10 unmodified lines