Options
All
  • Public
  • Public/Protected
  • All
Menu

The ResolverBase class handles resolving a factory method and detects recursion. Since JS does not have a synchronization mechanism (lock or otherwise) we have to prevent getValue from double triggering the value factory (optimistic concurrency) or returning return a value that is intermediate between resolving and resolved.

Type parameters

  • T

Hierarchy

Implements

Index

Constructors

constructor

  • new ResolverBase(_valueFactory: Func<T>, _trapExceptions: boolean, _allowReset?: boolean): ResolverBase

Properties

Private Optional _allowReset

_allowReset: boolean

Protected _disposableObjectName

_disposableObjectName: string

Protected _error

_error: any

Protected _isValueCreated

_isValueCreated: boolean

Private _trapExceptions

_trapExceptions: boolean

Protected _value

_value: T

Protected _valueFactory

_valueFactory: Func<T>

Accessors

canReset

  • get canReset(): boolean
  • Returns boolean

error

  • get error(): any
  • Returns any

wasDisposed

  • get wasDisposed(): boolean

Methods

Protected _onDispose

  • _onDispose(): void

dispose

  • dispose(): void

Protected getError

  • getError(): any
  • Returns any

getValue

  • getValue(): T
  • Returns T

Protected throwIfDisposed

  • throwIfDisposed(message?: string, objectName?: string): boolean
  • Parameters

    • Optional message: string
    • Default value objectName: string = this._disposableObjectName

    Returns boolean

tryReset

  • tryReset(): boolean
  • Returns boolean

Generated using TypeDoc