Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/machty/ember-concurrency
ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
https://github.com/machty/ember-concurrency
Last synced: about 14 hours ago
JSON representation
ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
- Host: GitHub
- URL: https://github.com/machty/ember-concurrency
- Owner: machty
- License: mit
- Created: 2016-01-07T06:47:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-23T22:48:30.000Z (about 2 months ago)
- Last Synced: 2024-11-06T13:07:32.348Z (8 days ago)
- Language: JavaScript
- Homepage: http://ember-concurrency.com
- Size: 57.8 MB
- Stars: 689
- Watchers: 18
- Forks: 157
- Open Issues: 83
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ember - ember-concurrency - Ember.js Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks. (Packages / Control flow)
README
# ember-concurrency
[![Build Status][build-status-img]][build-status-link]
[![NPM][npm-badge-img]][npm-badge-link]
[![Ember Observer Score][ember-observer-badge]][ember-observer-url]
![Ember Version][ember-version]Improved concurrency primitives for Ember.js. Documentation can be
found [here](http://ember-concurrency.com).## Installation
`ember-concurrency` is an ember-cli addon. You can install it via:
ember install ember-concurrency
### Configure Babel Transform
Ember Concurrency requires the use of a Babel Transform to convert tasks in the "async-arrow" notation (e.g. `fooTask = task(async () => { /*...*/ }`) into generator functions. Since Ember Concurrency 4.0.0+ is an Embroider V2 Addon, this Babel transform needs to be configured on the consuming application or addon.
```js
// in app ember-cli-build.jsconst app = new EmberApp(defaults, {
// ...
babel: {
plugins: [
// ... any other plugins
require.resolve("ember-concurrency/async-arrow-task-transform"),// NOTE: put any code coverage plugins last, after the transform.
],
}
});// in V1 addon index.js
// ...
options: {
babel: {
plugins: [
require.resolve('ember-concurrency/async-arrow-task-transform'),
],
},
},// in V2 addon babel.config.json
{
"plugins": [
[
// ... any other plugins
"ember-concurrency/async-arrow-task-transform"
]
}
```See the [test application](https://github.com/machty/ember-concurrency/blob/master/packages/test-app/ember-cli-build.js) for an example.
## Documentation
The [ember-concurrency documentation site](http://ember-concurrency.com) is an ember-cli app
with interactive examples powered by ember-concurrency. It runs from
ember-concurrency's [test app](https://github.com/machty/ember-concurrency/tree/master/packages/test-app/app).## Problems?
- [Open an Issue](https://github.com/machty/ember-concurrency/issues).
- Try to replicate the issue within an [ember-twiddle][twiddle-starter]
- Ask a question in the `#e-concurrency` channel at the [Ember Community Discord server](https://discord.gg/zT3asNS)## Contributing
See the [Contributing](CONTRIBUTING.md) guide for details.
[build-status-img]: https://github.com/machty/ember-concurrency/workflows/CI/badge.svg
[build-status-link]: https://github.com/machty/ember-concurrency
[npm-badge-img]: https://badge.fury.io/js/ember-concurrency.svg
[npm-badge-link]: http://badge.fury.io/js/ember-concurrency
[ember-observer-badge]: http://emberobserver.com/badges/ember-concurrency.svg
[ember-observer-url]: http://emberobserver.com/addons/ember-concurrency
[ember-version]: https://img.shields.io/badge/Ember-3.8+-brightgreen.svg
[twiddle-starter]: https://ember-twiddle.com/b2b0c016f4df24261381487b60c707f3?numColumns=2&openFiles=templates.application.hbs%2Ctemplates.application.hbs