Skip to content
Myr

Improve Flow type definition file (Fixes #80)

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

Adds a Flow annotation, and provides name for the default exported function to fix errors with Flow type checking.

authored by Marcin Szczepanski · committed by Marcin Szczepanski · parent ad5a86a · Browse files · 1 file+7 added−5 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+7 added−5 removed

  • other:+7 added−5 removed

1 file+7 added−5 removed

modified:src/immer.js.flow+7 added-5 removed
1// @flow23declare export function extendShallowObservable(target: any): any45/**6 * Immer takes a state, and runs a function against it.
6 unmodified lines
13 * @param currentState - the state to start with14 * @param thunk - function that receives a proxy of the current state as first argument and which can be freely modified15 * @returns The next state: a new state, or the current state if nothing was modified16 */15declare export default function<S>(17declare export default function produce<S>(18 currentState: S,19 recipe: (draftState: S) => void20): S21// curried invocations20declare export default function<S, A, B, C>(22declare export default function produce<S, A, B, C>(23 recipe: (draftState: S, a: A, b: B, c: C) => void24): (currentState: S, a: A, b: B, c: C) => S23declare export default function<S, A, B>(25declare export default function produce<S, A, B>(26 recipe: (draftState: S, a: A, b: B) => void27): (currentState: S, a: A, b: B) => S26declare export default function<S, A>(28declare export default function produce<S, A>(29 recipe: (draftState: S, a: A) => void30): (currentState: S) => S29declare export default function<S>(31declare export default function produce<S>(32 recipe: (draftState: S, ...extraArgs: any[]) => void33): (currentState: S, ...extraArgs: any[]) => S3435/**
12 unmodified lines