Skip to content

Commit

Permalink
Update MobX 4 observable factories
Browse files Browse the repository at this point in the history
  • Loading branch information
quanganhtran committed Apr 14, 2018
1 parent a867c00 commit 6f0bb9b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions flow-typed/mobx.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// @flow

export type CreateObservableOptions = {
name?: string,
deep?: boolean,
defaultDecorator?: any
}

export type IObservableMapInitialValues<K, V> = IMapEntries<K, V> | KeyValueMap<V> | IMap<K, V>

export interface IMobxConfigurationOptions {
Expand Down Expand Up @@ -234,13 +240,13 @@ export interface IObservableFactory {
}

declare export class IObservableFactories {
box<T>(value?: T, name?: string): IObservableValue<T>,
array<T>(initialValues?: T[], name?: string): IObservableArray<T>,
box<T>(value?: T, options?: CreateObservableOptions): IObservableValue<T>,
array<T>(initialValues?: T[], options?: CreateObservableOptions): IObservableArray<T>,
map<K, V>(
initialValues?: IObservableMapInitialValues<K, V>,
name?: string
options?: CreateObservableOptions
): ObservableMap<K, V>,
object<T>(props: T, name?: string): T & IObservableObject,
object<T>(props: T, options?: CreateObservableOptions): T & IObservableObject,
ref(target: Object, property?: string, descriptor?: PropertyDescriptor): any,
shallow(target: Object, property?: string, descriptor?: PropertyDescriptor): any,
deep(target: Object, property?: string, descriptor?: PropertyDescriptor): any
Expand Down

0 comments on commit 6f0bb9b

Please sign in to comment.