Asynchronous Task, like a promise but lazy and typed on error

### Type parameters

- #### T

  Type of the Task value on success

- #### E

  Type of the Task error on failure

### Hierarchy

- Task

## Index

### Constructors

- constructor

### Properties

- resolver

### Methods

- fork
- reject
- resolve

## Constructors

### constructor

- new Task(resolver: function): Task

- - Defined in src/task/task.ts:12

  Creates a new task using a `resolver` function. Pretty much like a promise creation

      const task = new Task((resolve, reject) => {
        setTimeout(_ => resolve('value'), 1000)
      })

  #### Parameters

  - ##### resolver: function

    Function to resolve or reject the task

    - - (resolve: function, reject: function): void

      - #### Parameters

        - ##### resolve: function

          - - (value: T): void

            - #### Parameters

              - ##### value: T

              #### Returns void

        - ##### reject: function

          - - (err: E): void

            - #### Parameters

              - ##### err: E

              #### Returns void

  #### Returns Task

## Properties

### Private resolver

resolver: function

- Defined in src/task/task.ts:25

Function to resolve or reject the task

#### Type declaration

- - (resolve: function, reject: function): void

  - #### Parameters

    - ##### resolve: function

      - - (value: T): void

        - #### Parameters

          - ##### value: T

          #### Returns void

    - ##### reject: function

      - - (err: E): void

        - #### Parameters

          - ##### err: E

          #### Returns void

## Methods

### fork

- fork(errorFn: function, successFn: function): void

- - Defined in src/task/task.ts:43

  #### Parameters

  - ##### errorFn: function

    - - (error: E): any

      - #### Parameters

        - ##### error: E

        #### Returns any

  - ##### successFn: function

    - - (value: T): any

      - #### Parameters

        - ##### value: T

        #### Returns any

  #### Returns void

### Static reject

- reject<E, T>(error: E): Task<T, E>

- - Defined in src/task/task.ts:37

  #### Type parameters

  - #### E

  - #### T

  #### Parameters

  - ##### error: E

  #### Returns Task<T, E>

### Static resolve

- resolve<T, E>(value: T): Task<T, E>

- - Defined in src/task/task.ts:29

  #### Type parameters

  - #### T

  - #### E

  #### Parameters

  - ##### value: T

  #### Returns Task<T, E>

Generated using TypeDoc