https://github.com/orlowdev/or-else
A set of tools for capturing and maintaining multiple application flows.
https://github.com/orlowdev/or-else
Last synced: about 1 year ago
JSON representation
A set of tools for capturing and maintaining multiple application flows.
- Host: GitHub
- URL: https://github.com/orlowdev/or-else
- Owner: orlowdev
- License: mit
- Created: 2020-11-17T12:42:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T16:23:12.000Z (over 3 years ago)
- Last Synced: 2024-03-26T12:04:37.983Z (about 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 899 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- Contributing: .github/contributing.md
- Funding: .github/funding.yml
- License: license.md
- Code of conduct: .github/code_of_conduct.md
- Codeowners: .github/codeowners
- Security: .github/security.md
Awesome Lists containing this project
README
# ||else
[](https://codeclimate.com/github/orlovedev/or-else/maintainability)
[](https://codecov.io/gh/orlovedev/or-else)
[](https://github.com/prettier/prettier)
[](https://github.com/orlovedev/or-release)
A set of tools for capturing and maintaining multiple application flows.
## Contents
- `Switch` works like the ordinary `switch`: you provide the cases and the default value, it jumps in to the proper case or falls through to the default result. The cases may be matched against a **value** or with a **function**.
- `LazySwitch` is like the previous `Switch` but it accepts the value to be matched against provided prefixes in a `match` method. The cases may be matched against a **value** or with a **function**.
- `Either` is a monad with a `Left` and a `Right` state that can be used for capturing uncommon behaviour or maintaining two flows of application execution at once.
## Installation
```sh
yarn add or-else
```
or
```sh
npm i -S or-else
```
## Examples
TBD