Skip to content
Myr

Update types

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

authored by RichieAHB · committed by RichieAHB · parent f0934ab · Browse files · 4 files+28 added−15 removed
This commit

State

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

Diff stats

4 files+28 added−15 removed

  • tests:+26 added−13 removed
  • other:+2 added−2 removed

4 files+28 added−15 removed

modified:__tests__/flow/flow.js.flow+12 added-6 removed
95 unmodified lines
96}9798{99 produce({x: 3}, draftState => {100 original(draftState).x101 // $ExpectError102 original(draftState).y100 let a = original(draftState)101 if (a) {102 a.x103 // $ExpectError104 a.y105 }106 })107}108109{110 produce([1], draftState => {108 const a: number = original(draftState)[0];109 // $ExpectError110 const b: string = original(draftState)[0];111 const a = original(draftState);112 if (a) {113 const b: number = a[0];114 // $ExpectError115 const c: string = a[0];116 }117 })118}
modified:__tests__/flow/ts.ts+14 added-7 removed
modified:src/immer.d.ts+1 added-1 removed
109 unmodified lines
110export function setUseProxies(useProxies: boolean): void111112export function applyPatches<S>(state: S, patches: Patch[]): S113114export function original<T>(value: T): T114export function original<T>(value: T): T | void
modified:src/immer.js.flow+1 added-1 removed
83 unmodified lines
84declare export function setUseProxies(useProxies: boolean): void8586declare export function applyPatches<S>(state: S, patches: Patch[]): S8788declare export function original<S>(value: S): S88declare export function original<S>(value: S): ?S