Skip to content

Commit

Permalink
feat: export isDraft function
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Oct 16, 2018
1 parent 09d69ae commit 13263c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/immer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,5 @@ export function setUseProxies(useProxies: boolean): void
export function applyPatches<S>(state: S, patches: Patch[]): S

export function original<T>(value: T): T | void

export function isDraft(value: any): boolean
2 changes: 1 addition & 1 deletion src/immer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {setAutoFreeze, setUseProxies, original} from "./common"
export {setAutoFreeze, setUseProxies, original, isProxy as isDraft} from "./common"

import {applyPatches as applyPatchesImpl} from "./patches"
import {isProxyable, getUseProxies, NOTHING} from "./common"
Expand Down
4 changes: 3 additions & 1 deletion src/immer.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ declare export function setUseProxies(useProxies: boolean): void

declare export function applyPatches<S>(state: S, patches: Patch[]): S

declare export function original<S>(value: S): ?S
declare export function original<S>(value: S): ?S

declare export function isDraft(value: any): boolean

0 comments on commit 13263c0

Please sign in to comment.