
`async-wave` is a safely executed asynchronous function that sequentially executes a chain of callback functions and returns the result. It safely transforms any value into a Promise and passes it as an argument to the asynchronous function. This allows for easy management of asynchronous operations and returning of results. Additionally, `asyncWave` provides intuitive implementation of error handling, success handling, and other logic through callback functions. This enables developers to write safe and efficient asynchronous code.
- [🇰🇷 한êµì–´](./README.md) ## Table of Contents - [Installing](#installing) - [Package manager](#package-manager) - [CDN](#cdn) - [Usage](#usage) ## Installing ### Package manager Using npm: ```bash $ npm install async-wave ``` Using yarn: ```bash $ yarn add async-wave ``` ### CDN Using unpkg CDN: ```html ``` # Usage ### Before ```ts // Promises chaining await setFetchLog(); startLoadingIndicator(); getGithubUser(USER_NAME) .then(loadJson) .then(showAvatar) .then((githubUser) => console.log(`avatar_url: ${githubUser.avatar_url}`)) .catch((error) => console.error(error)) .finally(endLoadingIndicator); ``` ### After ```typescript import { asyncWave } from 'async-wave'; // if a function is passed as the first argument and its return value is not a promise, an error will be thrown. asyncWave