Framework base class 'Domain', class must be extends this base class which is need to be observable.

Type Parameters

  • S extends object = {}

Constructors

Properties

$$turboxProperties: {
    $$turboxProperties?: { $$turboxProperties?: ... | undefined; initDomainContext?: (() => DomainContext) | undefined; propertyGet?: ((key: string, config: ReactorConfig, hasInitializer?: boolean, defaultValue?: any) => any) | undefined; propertySet?: ((key: string, v: any, config: ReactorConfig) => void) | undefined; computedPropertyGet?:...;
    $update?<K>(obj, actionName?, displayName?, forceSaveHistory?, isNeedRecord?, immediately?): void;
    computedPropertyGet?<T>(key, options?, descriptor?): T;
    computedPropertySet?<T>(key, original): void;
    initDomainContext?(): DomainContext;
    propertyGet?(key, config, hasInitializer?, defaultValue?): any;
    propertySet?(key, v, config): void;
} = {}

Type declaration

  • Optional $$turboxProperties?: { $$turboxProperties?: ... | undefined; initDomainContext?: (() => DomainContext) | undefined; propertyGet?: ((key: string, config: ReactorConfig, hasInitializer?: boolean, defaultValue?: any) => any) | undefined; propertySet?: ((key: string, v: any, config: ReactorConfig) => void) | undefined; computedPropertyGet?:...
  • $update?:function
    • the syntax sweet of updating state out of mutation

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • obj: S | Pick<S, K>
      • Optional actionName: string
      • Optional displayName: string
      • Optional forceSaveHistory: boolean
      • Optional isNeedRecord: boolean
      • Optional immediately: boolean

      Returns void

  • computedPropertyGet?:function
    • Type Parameters

      • T

      Parameters

      • key: string
      • Optional options: ComputedOption
      • Optional descriptor: PropertyDescriptor

      Returns T

  • computedPropertySet?:function
  • initDomainContext?:function
  • propertyGet?:function
    • Parameters

      • key: string
      • config: ReactorConfig
      • hasInitializer: boolean = false
      • Optional defaultValue: any

      Returns any

  • propertySet?:function
computedProperties: {
    $$turboxProperties?: ComputedConfig<{
        $$turboxProperties?: { $$turboxProperties?: ... | undefined; initDomainContext?: (() => DomainContext) | undefined; propertyGet?: ((key: string, config: ReactorConfig, hasInitializer?: boolean, defaultValue?: any) => any) | undefined; propertySet?: ((key: string, v: any, config: ReactorConfig) => void) | undefined; computedPropertyGet?:...;
        $update?<K>(obj, actionName?, displayName?, forceSaveHistory?, isNeedRecord?, immediately?): void;
        computedPropertyGet?<T>(key, options?, descriptor?): T;
        computedPropertySet?<T>(key, original): void;
        initDomainContext?(): DomainContext;
        propertyGet?(key, config, hasInitializer?, defaultValue?): any;
        propertySet?(key, v, config): void;
    }>;
    $update?: any;
    computedPropertyGet?: any;
    computedPropertySet?: any;
    initDomainContext?: any;
    propertyGet?: any;
    propertySet?: any;
} = {}

Type declaration

  • Optional $$turboxProperties?: ComputedConfig<{
        $$turboxProperties?: { $$turboxProperties?: ... | undefined; initDomainContext?: (() => DomainContext) | undefined; propertyGet?: ((key: string, config: ReactorConfig, hasInitializer?: boolean, defaultValue?: any) => any) | undefined; propertySet?: ((key: string, v: any, config: ReactorConfig) => void) | undefined; computedPropertyGet?:...;
        $update?<K>(obj, actionName?, displayName?, forceSaveHistory?, isNeedRecord?, immediately?): void;
        computedPropertyGet?<T>(key, options?, descriptor?): T;
        computedPropertySet?<T>(key, original): void;
        initDomainContext?(): DomainContext;
        propertyGet?(key, config, hasInitializer?, defaultValue?): any;
        propertySet?(key, v, config): void;
    }>
context: DomainContext
currentTarget?: any
originalArrayLength?: number
reactorConfigMap: {
    $$turboxProperties?: ReactorConfig;
    $update?: any;
    computedPropertyGet?: any;
    computedPropertySet?: any;
    initDomainContext?: any;
    propertyGet?: any;
    propertySet?: any;
} = {}

Type declaration

  • Optional $$turboxProperties?: ReactorConfig

Methods

  • the syntax sweet of updating state out of mutation

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • obj: S | Pick<S, K>
    • Optional actionName: string
    • Optional displayName: string
    • Optional forceSaveHistory: boolean
    • Optional isNeedRecord: boolean
    • Optional immediately: boolean

    Returns void

  • Type Parameters

    • T

    Parameters

    • key: string
    • Optional options: ComputedOption
    • Optional descriptor: PropertyDescriptor

    Returns T

  • Parameters

    • obj: object
    • Optional actionName: string
    • Optional displayName: string
    • Optional forceSaveHistory: boolean
    • Optional isNeedRecord: boolean
    • Optional immediately: boolean

    Returns void

  • Parameters

    • target: Collection
    • proxyKey: string

    Returns {
        [iterator]: (() => any);
        add: ((value) => any);
        clear: (() => any);
        delete: ((key) => any);
        entries: (() => any);
        forEach: ((callbackfn) => any);
        get: ((key) => any);
        has: ((key) => any);
        keys: (() => any);
        set: ((key, value) => any);
        values: (() => any);
        get size(): any;
    }

    • [iterator]: (() => any)
        • (): any
        • Returns any

    • add: ((value) => any)
        • (value): any
        • Parameters

          • value: any

          Returns any

    • clear: (() => any)
        • (): any
        • Returns any

    • delete: ((key) => any)
        • (key): any
        • Parameters

          • key: any

          Returns any

    • entries: (() => any)
        • (): any
        • Returns any

    • forEach: ((callbackfn) => any)
        • (callbackfn): any
        • Parameters

          • callbackfn: ((value, key, map) => void)
              • (value, key, map): void
              • Parameters

                • value: any
                • key: any
                • map: Map<any, any>

                Returns void

          Returns any

    • get: ((key) => any)
        • (key): any
        • Parameters

          • key: any

          Returns any

    • has: ((key) => any)
        • (key): any
        • Parameters

          • key: any

          Returns any

    • keys: (() => any)
        • (): any
        • Returns any

    • set: ((key, value) => any)
        • (key, value): any
        • Parameters

          • key: any
          • value: any

          Returns any

    • values: (() => any)
        • (): any
        • Returns any

    • get size(): any
  • observed value could be assigned value to

    Parameters

    • target: object
    • stringKey: string

    Returns void

    Reactor

    only in @mutation/$update, otherwise throw error.

  • Parameters

    • key: string
    • config: ReactorConfig
    • hasInitializer: boolean = false
    • Optional defaultValue: any

    Returns any

  • proxy value could be boolean, string, number, undefined, null, custom instance, array[], plainObject{}, Map, Set, WeakMap, WeakSet

    Parameters

    • raw: object
    • keyPath: {
          type: KeyPathType;
          value: string;
      }[]

    Returns any

Generated using TypeDoc