# Class Resolvable

The basic building block for the resolve system.

Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise), and the unwrapped-when-complete (.data) result of the resolveFn.

Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the resolveFn) and returns the resulting promise.

Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first parameter to those fns.

- Defined in src/router/resolve/resolvable.js:28
- Defined in src/router/resolve/resolvable.js:122

##### Index

### Constructors

constructor

### Properties

data
deps
policy
promise
resolved
resolveFn
token

### Methods

clone
get
getPolicy
resolve
toString
fromData

## Constructors

### constructor

- new Resolvable(
  arg1: any,
  resolveFn: any,
  deps: any,
  policy: any,
  data: any,
  ): Resolvable

  #### Parameters

  - arg1: any
  - resolveFn: any
  - deps: any
  - policy: any
  - data: any

  #### Returns Resolvable

  - Defined in src/router/resolve/resolvable.js:29

## Properties

### data

data: any

- Defined in src/router/resolve/resolvable.js:40
- Defined in src/router/resolve/resolvable.js:52
- Defined in src/router/resolve/resolvable.js:90

### deps

deps: any

- Defined in src/router/resolve/resolvable.js:39
- Defined in src/router/resolve/resolvable.js:50

### policy

policy: any

- Defined in src/router/resolve/resolvable.js:37
- Defined in src/router/resolve/resolvable.js:51

### promise

promise: Promise<any>

- Defined in src/router/resolve/resolvable.js:31
- Defined in src/router/resolve/resolvable.js:42
- Defined in src/router/resolve/resolvable.js:97

### resolved

resolved: boolean

- Defined in src/router/resolve/resolvable.js:30
- Defined in src/router/resolve/resolvable.js:41
- Defined in src/router/resolve/resolvable.js:91

### resolveFn

resolveFn: any

- Defined in src/router/resolve/resolvable.js:38
- Defined in src/router/resolve/resolvable.js:49
- Defined in src/router/resolve/resolvable.js:92

### token

token: any

- Defined in src/router/resolve/resolvable.js:36
- Defined in src/router/resolve/resolvable.js:48

## Methods

### clone

- clone(): Resolvable

  #### Returns Resolvable

  - Defined in src/router/resolve/resolvable.js:118

### get

- get(resolveContext: any, trans: any): Promise<any>

  Gets a promise for this Resolvable's data.

  Fetches the data and returns a promise. Returns the existing promise if it has already been fetched once.

  #### Parameters

  - resolveContext: any
  - trans: any

  #### Returns Promise<any>

  - Defined in src/router/resolve/resolvable.js:110

### getPolicy

- getPolicy(state: any): { async: any; when: any }

  #### Parameters

  - state: any

  #### Returns { async: any; when: any }

  - Defined in src/router/resolve/resolvable.js:56

### resolve

- resolve(resolveContext: any, trans: any): Promise<any>

  Asynchronously resolve this Resolvable's data

  Given a ResolveContext that this Resolvable is found in: Wait for this Resolvable's dependencies, then invoke this Resolvable's function and update the Resolvable's state

  #### Parameters

  - resolveContext: any
  - trans: any

  #### Returns Promise<any>

  - Defined in src/router/resolve/resolvable.js:73

### toString

- toString(): string

  #### Returns string

  - Defined in src/router/resolve/resolvable.js:114

### `Static` fromData

- fromData(token: any, data: any): Resolvable

  #### Parameters

  - token: any
  - data: any

  #### Returns Resolvable

  - Defined in src/router/resolve/resolvable.js:122