test: wip tests for observer
This commit is contained in:
@@ -32,12 +32,13 @@ export type Debugger = (event: DebuggerEvent) => void
|
||||
|
||||
export const activeAutorunStack: Autorun[] = []
|
||||
|
||||
const ITERATE_KEY = Symbol('iterate')
|
||||
export const ITERATE_KEY = Symbol('iterate')
|
||||
|
||||
export function createAutorun(fn: Function, options: AutorunOptions): Autorun {
|
||||
const runner = function runner(...args): any {
|
||||
return run(runner as Autorun, fn, args)
|
||||
} as Autorun
|
||||
runner.isAutorun = true
|
||||
runner.active = true
|
||||
runner.raw = fn
|
||||
runner.scheduler = options.scheduler
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
} from './autorun'
|
||||
|
||||
export { Autorun, DebuggerEvent }
|
||||
export { OperationTypes } from './operations'
|
||||
export { computed, ComputedGetter } from './computed'
|
||||
export { lock, unlock } from './lock'
|
||||
|
||||
@@ -40,7 +41,7 @@ const canObserve = (value: any): boolean => {
|
||||
)
|
||||
}
|
||||
|
||||
type identity = <T>(target: T) => T
|
||||
type identity = <T>(target?: T) => T
|
||||
|
||||
export const observable = ((target: any = {}): any => {
|
||||
// if trying to observe an immutable proxy, return the immutable version.
|
||||
|
||||
Reference in New Issue
Block a user