# 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 router/resolve/resolvable.js:23
- Defined in router/resolve/resolvable.js:119

#####
Index

### Constructors

constructor

### Properties

data
deps
policy
promise
resolveFn
resolved
token

### Methods

clone
get
getPolicy
resolve
toString
fromData

##
Constructors

### constructor

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

- #### Parameters

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

  #### Returns Resolvable

  - Defined in router/resolve/resolvable.js:24

##
Properties

### data

data: any

- Defined in router/resolve/resolvable.js:35
- Defined in router/resolve/resolvable.js:48
- Defined in router/resolve/resolvable.js:87

### deps

deps: any

- Defined in router/resolve/resolvable.js:34
- Defined in router/resolve/resolvable.js:46

### policy

policy: any

- Defined in router/resolve/resolvable.js:32
- Defined in router/resolve/resolvable.js:47

### promise

promise: any

- Defined in router/resolve/resolvable.js:26
- Defined in router/resolve/resolvable.js:37
- Defined in router/resolve/resolvable.js:94

### resolveFn

resolveFn: any

- Defined in router/resolve/resolvable.js:33
- Defined in router/resolve/resolvable.js:45
- Defined in router/resolve/resolvable.js:89

### resolved

resolved: boolean

- Defined in router/resolve/resolvable.js:25
- Defined in router/resolve/resolvable.js:36
- Defined in router/resolve/resolvable.js:88

### token

token: any

- Defined in router/resolve/resolvable.js:31
- Defined in router/resolve/resolvable.js:44

##
Methods

### clone

- clone(): Resolvable

- #### Returns Resolvable

  - Defined in router/resolve/resolvable.js:115

### get

- get(resolveContext, trans): 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 any

  - Defined in router/resolve/resolvable.js:107

### getPolicy

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

- #### Parameters

  - state: any

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

  - ##### async: any

  - ##### when: any

  - Defined in router/resolve/resolvable.js:52

### resolve

- resolve(resolveContext, trans): 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 any

  - Defined in router/resolve/resolvable.js:69

### toString

- toString(): string

- #### Returns string

  - Defined in router/resolve/resolvable.js:111

### `Static` fromData

- fromData(token, data): Resolvable

- #### Parameters

  - token: any
  - data: any

  #### Returns Resolvable

  - Defined in router/resolve/resolvable.js:119