# Interface ResolvableLiteral

A plain object used to describe a [[Resolvable]]

These objects may be used in the [[StateDeclaration.resolve]] array to declare async data that the state or substates require.

#### Example:

    var state = {
      name: 'main',
      resolve: [
        { token: 'myData', deps: [MyDataApi], resolveFn: (myDataApi) => myDataApi.getData() },
      ],
    }

interface ResolvableLiteral {
data?: any;
deps?: any[];
policy?: ResolvePolicy;
resolveFn: Function;
token: any;
}

- Defined in src/router/resolve/interface.ts:39

##### Index

### Properties

data?
deps?
policy?
resolveFn
token

## Properties

### `Optional` data

data?: any

Pre-resolved data.

- Defined in src/router/resolve/interface.ts:81

### `Optional` deps

deps?: any[]

The Dependency Injection tokens

This is an array of Dependency Injection tokens for the dependencies of the [[resolveFn]].

The DI tokens are references to other `Resolvables`, or to other services from the native DI system.

- Defined in src/router/resolve/interface.ts:78

### `Optional` policy

policy?: ResolvePolicy

Defines the Resolve Policy

A policy that defines when to invoke the resolve, and whether to wait for async and unwrap the data

- Defined in src/router/resolve/interface.ts:68

### resolveFn

resolveFn: Function

A function which fetches the Resolvable's data

A function which returns one of:

- The resolved value (synchronously)
- A promise for the resolved value
- An Observable of the resolved value(s)

This function will be provided the dependencies listed in [[deps]] as its arguments. The resolve system will asynchronously fetch the dependencies before invoking this function.

- Defined in src/router/resolve/interface.ts:60

### token

token: any

A Dependency Injection token

This Resolvable's DI token. The Resolvable will be injectable elsewhere using the token.

- Defined in src/router/resolve/interface.ts:46