Removed unused stuff
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 19a6b66 · Browse files · 7 files·+5 added−24 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+5 added−24 removed
- other:+5 added−24 removed
Provenance
- Commit
74c0536- Tree
a68c5d8- Author
Michel Weststrate <mweststrate@fb.com>- Committer
Michel Weststrate <mweststrate@fb.com>- Parent
19a6b66
7 files changed+5 added−24 removed
modified:src/es5.ts-2 removed
6 unmodified lines7 isDraftable,8 isEnumerable,9 isMap,10 isSet,11- hasSymbol,11 shallowCopy,12 DRAFT_STATE,13 latest14 } from "./common"15 16 import {ImmerScope} from "./scope"17 import {ImmerState, Drafted, AnyObject, AnyMap} from "./types"19-import {markChanged} from "./proxy"18 19 // TODO: merge with ImmerState?20 interface ES5BaseState {21 scope: ImmerScope298 unmodified linesmodified:src/immer.ts-1 removed
15 unmodified lines16 shallowCopy,17 DRAFT_STATE,18 NOTHING,19 freeze,20- latest,20 isPlainObject,21 DRAFTABLE22 } from "./common"23 import {ImmerScope} from "./scope"445 unmodified linesmodified:src/map.ts+1 added-3 removed
123436456723 unmodified lines313233343536373839130 unmodified linesExpand allimport {isDraftable, DRAFT_STATE, latest} from "./common"
// TODO: kill:import {assertUnrevoked} from "./es5"import {ImmerScope} from "./scope"import {Immer} from "./immer"import {AnyMap, Drafted} from "./types"
// TODO: create own states// TODO: clean up the maps and such from ES5 / Proxy states23 unmodified linesconst MapBase: MapConstructor = typeof Map !== "undefined" ? Map : (function FakeMap() {} as any)
// TODO: fix types for drafts// TODO: assert unrevokedexport class DraftMap<K, V> extends MapBase implements Map<K, V> { [DRAFT_STATE]: MapState constructor(target, parent) { super()130 unmodified linesExpand allmodified:src/proxy.ts-7 removed
3 unmodified lines4 each,5 has,6 is,7 isDraftable,8- isDraft,8 isMap,9 isSet,11- hasSymbol,10 shallowCopy,11 DRAFT_STATE,14- assignMap,15- assignSet,16- original,12 latest13 } from "./common"14 import {ImmerScope} from "./scope"20-import {proxyMap} from "./map"21-import {proxySet} from "./set"15 import {AnyObject, Drafted, ImmerState, AnyArray} from "./types"16 17 interface ProxyBaseState {18 scope: ImmerScope228 unmodified linesmodified:src/scope.ts+2 added-2 removed
1 import {DRAFT_STATE} from "./common"2-import {ImmerState, Patch, PatchListener} from "./types"3-import { Immer } from "./immer"2+import {Patch, PatchListener} from "./types"3+import {Immer} from "./immer"4 5 /** Each scope represents a `produce` call. */6 export class ImmerScope {7 static current?: ImmerScope53 unmodified linesmodified:src/set.ts+2 added-2 removed
1-import {isDraftable, DRAFT_STATE, latest} from "./common"1+import {DRAFT_STATE, latest} from "./common"2 3 // TODO: kill:4-import {assertUnrevoked} from "./es5"4 import {ImmerScope} from "./scope"5 import {AnySet, Drafted} from "./types"6 7 // TODO: create own states29 unmodified lines37 const SetBase: SetConstructor =38 typeof Set !== "undefined" ? Set : (function FakeSet() {} as any)39 40 // TODO: fix types for drafts41+// TODO: assert unrevoked42 export class DraftSet<K, V> extends SetBase implements Set<V> {43 [DRAFT_STATE]: SetState44 constructor(target, parent) {45 super()103 unmodified linesmodified:src/types.ts-7 removed
6 unmodified lines7 export type Objectish = any[] | Map<any, any> | Set<any> | {}8 9 export type ObjectishNoSet = any[] | Map<any, any> | {}10 11-// export interface ImmerState<T = any> {12-// parent?: ImmerState13-// base: T14-// copy: T15-// assigned: {[prop: string]: boolean; [index: number]: boolean}16-// }17-11 export type AnyObject = {[key: string]: any}12 export type AnyArray = Array<any>13 export type AnySet = Set<any>14 export type AnyMap = Map<any, any>195 unmodified lines