1.4.0 • Published 3 years ago

@jumpaku/async-result v1.4.0

Weekly downloads
2,044
License
BSD-2-Clause
Repository
github
Last release
3 years ago

AsyncResult

A typescript library that provides Result and AsyncResult.

  • Result<V, E> represents a result of a computation.

    • It has a value of the type V if the computation is succeeded.
    • It has an error of the type E if the computation is failed.
  • AsyncResult<V, E> represents an asynchronous result of a computation.

    • It is implemented as a wrapper of Promise<Result<V, E>>.
    • It takes one of the three kinds of states:
      1. Pending: the computation has not been completed.
      2. Succeeded: the computation succeeded with a value.
      3. Failed: the computation failed by an error.

Examples

API

Contribution

Commit massages

  • feat
  • build
  • fix
  • docs

https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines

Development

Build

git clone https://github.com/Jumpaku/AsyncResult.git
cd AsyncResult
npm install
npm run test

Publish

npm run build
npm run test
npm version minor
npm publish --access public
1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago