ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
MIT License
Bot releases are hidden (Show)
Implement decorators from ember-concurrency-decorators
(#386). The "nice" decorators
from ember-concurrency-decorators
are now built-in to ember-concurrency, without
requiring an additional addon or seperate import. All decorators are available for
import directly from the top-level ember-concurrency
package.
Many thanks to @buschtoens for years of stewardship of that addon, and important contributions from @chancancode for TypeScript support, and others in the community to get it to a place where it's seen wide adoption in the world of Ember Octane, TypeScript, and native ES classes.
Addon maintainers: Please see notes in UPGRADING-2.x.md
if you're using
decorators currently, and wish to support both ember-concurrency 1.x and 2.x at
runtime.
Published by maxfierke almost 4 years ago
Migrate task lifetimes to @ember/destroyable
underneath, rather than
patching willDestroy
(#377).
Potentially breaking: this drops support for Node 8 and Ember < 3.8 LTS
Ensure encapsulated task state can be accessed on the TaskInstance (#381, #383)
Note: this uses Proxy
and WeakMap
, which may need to be polyfilled/unavailable on
older browsers.
Make sure task/group-level state
field is tracked (#382)
Drop unused broccoli-file-creator
and ember-maybe-import-regenerator
dependencies.
Note on ember-maybe-import-regenerator
: This was originally added back when
generator support in browsers was far lower and Babel 5 and 6 were used. The
addon does nothing for Babel 7, which is used for ember-concurrency
these
days. Tweaking config/targets.js
or adding the regenerator Babel plugin to
your babel config can be done instead if the regenerator runtime is needed
to transpile generators for older browsers.
Published by maxfierke about 4 years ago
Port over changes from 1.1.6 through 1.3.0 (#367)
Use @tracked
underneath on Ember 3.16+ (#354)
Note: Within applications with both tracked & computed properties,
if using a native getter to access task state, and wishing to use it
alongside a computed property, @dependantKeyCompat
will need to be used on
the getter as expected with any other tracked-prop using getter.
-task-property
module (for compatibility w/ someTaskProperty
is available at the top-level.{{action}}
helper stuffget
and set
compatibility methods from Task
, TaskGroup
,TaskInstance
.Documentation about upgrading to 2.0.0-beta.1 and other future 2.x releases in
general can be found in UPGRADING-2.x.md
Published by maxfierke about 4 years ago
Add animationFrame
yieldable helper. Yielding animationFrame()
will
pause a task until after the next animation frame using the native
requestAnimationFrame()
browser API.
Note: ember-concurrency tasks are scheduled on the runloop, so this will
not cause the remainder of the task to instead run during the next animation
frame, but the runloop after the next animation frame. (#365, thanks @Turbo87!)
Add hashSettled
helper for cancellation-aware implementation of RSVP's hashSettled
(#353, thanks @kwliou!)
linked()
and unlinked()
(Fixes #373)Deprecate direct usage of task with action helper and disable tests for it
on 3.20+.
This feature unfortunately depends on private APIs that will be removed in
Ember 3.25. Unfortunately, the mechanism was already removed in Ember 3.20,
making it impossible to support this for releases at least until recent
canaries where it was re-introduced with a deprecation. However, the feature
is rarely used, only documented in this changelog, and frequently breaks
whenever the private constant it depends on moves modules internally
throughout new versions of Ember.
It will continue to remain available for Ember < 3.20, but will not be
available in Ember-Concurrency 2.0, and will show a deprecation warning from
1.3.0 forward.
Any existing uses can be converted to using {{perform}}
directly or
wrapping the task in (perform)
before passing to {{action}}
or {{fn}}
Before:
<button onClick={{action someTask}}>My button</button>
After:
{{!-- Any of these --}}
<button {{on "click" (perform someTask)}}>My button</button>
<button onClick={{perform someTask}}>My button</button>
<button onClick={{action (perform someTask)}}>My button</button>
<button onClick={{fn (perform someTask)}}>My button</button>
Published by maxfierke over 4 years ago
Published by maxfierke over 4 years ago
Introduce official TypeScript definitions targeting the last 3 versions of
TypeScript. A big, big thank you to @chancancode for this heroic effort!
Also, a thank you to all others before who worked on previous iterations of
typing experiments for ember-concurrency and provided feedback. If you were
using one of the community-provided solutions or other custom type definitions,
you will likely need to remove those and refactor to adhere to the new official
types. (#357)
For more information about using TypeScript with ember-concurrency, please see the new docs page
Published by maxfierke over 4 years ago
Published by maxfierke over 4 years ago
waitForEvent
helper on host objects supporting 'on' API. Previously, waitForEvent
only supported DOM-like objects with addEventListener
/removeEventListener
or jQuery-like objects with one
/off
, but did not support those with just on
/off
. (#348. Fixes #164)Published by maxfierke over 4 years ago
Published by maxfierke almost 5 years ago
Published by maxfierke almost 5 years ago
action
helper directly on Ember 2.8 (yes, 2.8)Published by maxfierke almost 5 years ago
rawTimeout
, waitForEvent
, and waitForQueue
helper timersrace
. (Fixes #309, #329)action
and fn
helpers in Ember 3.x (#312, #333. Thanks @thiagofelix for the find!)Published by maxfierke almost 5 years ago
Published by maxfierke about 5 years ago
rawTimeout
helper in top-level ember-concurrency
module. (#310, thanks @Turbo87)Published by maxfierke about 5 years ago
Array
for Promise helpers (race
, all
, allSettled
) (#313, thanks @buschtoens!)waitForQueue
when queue does not exist (#314, @mydea!)ember-maybe-import-regenerator
versions (#316, thanks @jherdman!)clearTimeout()
instead of clearInterval()
on timer set with setTimeout
(#309, thanks @Turbo87!)cancelAll()
(#305, thanks @ggayowsky!)Published by machty over 5 years ago
Internal upgrades to comply with new low level Descriptor API in newer versions of Ember.
Published by machty over 5 years ago
yield forever
to pause a task indefinitely (#274)