types: cleanup some unnecessary typing in reactivity (#126)
This commit is contained in:
committed by
Evan You
parent
31345b5af9
commit
3d975247cd
@@ -15,20 +15,20 @@ import { ReactiveEffect } from './effect'
|
||||
// raw Sets to reduce memory overhead.
|
||||
export type Dep = Set<ReactiveEffect>
|
||||
export type KeyToDepMap = Map<string | symbol, Dep>
|
||||
export const targetMap: WeakMap<any, KeyToDepMap> = new WeakMap()
|
||||
export const targetMap = new WeakMap<any, KeyToDepMap>()
|
||||
|
||||
// WeakMaps that store {raw <-> observed} pairs.
|
||||
const rawToReactive: WeakMap<any, any> = new WeakMap()
|
||||
const reactiveToRaw: WeakMap<any, any> = new WeakMap()
|
||||
const rawToReadonly: WeakMap<any, any> = new WeakMap()
|
||||
const readonlyToRaw: WeakMap<any, any> = new WeakMap()
|
||||
const rawToReactive = new WeakMap<any, any>()
|
||||
const reactiveToRaw = new WeakMap<any, any>()
|
||||
const rawToReadonly = new WeakMap<any, any>()
|
||||
const readonlyToRaw = new WeakMap<any, any>()
|
||||
|
||||
// WeakSets for values that are marked readonly or non-reactive during
|
||||
// observable creation.
|
||||
const readonlyValues: WeakSet<any> = new WeakSet()
|
||||
const nonReactiveValues: WeakSet<any> = new WeakSet()
|
||||
const readonlyValues = new WeakSet<any>()
|
||||
const nonReactiveValues = new WeakSet<any>()
|
||||
|
||||
const collectionTypes: Set<any> = new Set([Set, Map, WeakMap, WeakSet])
|
||||
const collectionTypes = new Set<Function>([Set, Map, WeakMap, WeakSet])
|
||||
const observableValueRE = /^\[object (?:Object|Array|Map|Set|WeakMap|WeakSet)\]$/
|
||||
|
||||
const canObserve = (value: any): boolean => {
|
||||
|
||||
Reference in New Issue
Block a user