Questions tagged [ember-concurrency]
14 questions
4
votes
1 answer
Ember concurrency timeout hanging in qunit
In Ember I have a component that starts a never-ending poll to keep some data up to date. Like so:
export default Component.extend({
pollTask: task(function * () {
while(true) {
yield timeout(this.get('pollRate'));
…

Glyoko
- 2,071
- 1
- 14
- 28
3
votes
1 answer
Cant we put a ember concurrency task in glimmer component getter, which is tracking the components arguments
-- when an ember concurrency task is called glimmer components getter then it runs in infinite loop.
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';
import…

kdhayal
- 83
- 6
2
votes
1 answer
Ember.JS concurrency task, perform() is not a function
I was trying to convert a function over to a task. Here is the original code:
Call:
this.socketConnect(endpoint, token);
Function:
socketConnect = async (token, endpoint) => {
this.socket = new WebSocket(endpoint + '?auth=' + token);
…

Floyd
- 65
- 6
2
votes
1 answer
Unit testing ember-concurrency tasks and yields
We have a lot of code in our project that isn't covered because of ember concurrency tasks.
Is there a straightforward way of unit testing an controller that contains something like the following:
export default Controller.extend({
…

PercivalMcGullicuddy
- 5,263
- 9
- 46
- 65
1
vote
1 answer
Yield not stopping the flow in ember concurrency task
if (isEmpty(contact) || isEmpty(get(contact, 'emails'))) {
contact = yield store.findRecord('contact', contactId);
}
if (isEmpty(contact) || isEmpty(get(contact, 'emails'))) {
flashMessages.danger(i18n.t('email.cpq_document_email_missing'));
…

Harsh Kumar
- 334
- 2
- 12
1
vote
0 answers
After upgrade to ember 3.15, helpers that yield promised recompute infinitely
I am having trouble zeroing in on this bug, but something happened when I upgraded from 3.13 to 3.15. In some (but not all) templates where I use the result of a helper in a let block, the helper will be rerendered infinitely.
{{#let…

John Larson
- 71
- 7
1
vote
1 answer
What is an effective strategy for polling in the router in Emberjs?
I need help on developing a good strategy for polling in the router. I have a route queries/:query_id/results/:result_id that I transition to whenever the user executes a query. In this I route I need to load two things: the result model that is…

Luis Averhoff
- 887
- 2
- 11
- 22
1
vote
0 answers
How do I type a decorated property which type is changed by the decorator?
Here's some code that works perfectly in JS:
import Component from '@ember/component';
import {task} from 'ember-concurrency';
class Foo extends Component {
currentRecordId!: string; // passed from template
@task
fetchRecord *(id) {
…

Andrey Mikhaylov - lolmaus
- 23,107
- 6
- 84
- 133
1
vote
1 answer
ember concurrency, how to set timout value based on conditions
I am using ember-concurrency where I have to make API calls every 10 seconds and update the setup status for my application install phase. If there is an error, then I need the timeout value to be 1 seconds instead if default value of 10 seconds.…

Bhavya Bansal
- 257
- 1
- 15
0
votes
2 answers
How do i get the ember-concurrency ajax-throttling example to work in my dev environment?
My question is, what do i need to fix so that my implementation of the ember-concurrency Ajax Throttling example works as expected. Specifically, in my implementation no log entries are displayed (as they are on the example page), and the…

tripper
- 27
- 1
- 7
0
votes
1 answer
{{did-update}} fall into infinite loop in ember js
I need to get store data when some properties change. Property value exist in the service, so I re-execute function using {{did-update}}.
But this action fall into infinite loop when the service property value changes.
This is my code.
js…

KingStar1001
- 44
- 5
0
votes
1 answer
How can I use ember-concurrency with a callback function?
I'd like to use ember-concurrency to handle batch validation of a collection of addresses. The address validation is done by a third party API that calls a server-side function that then 'calls back' to the client when the server has completed its…

tripper
- 27
- 1
- 7
0
votes
3 answers
How do I go about stubbing a Task in Ember.js?
I am using Sinon with Ember.js Concurrency Tasks and am trying to stub the task in a test.
The code looks something like this:
component .ts file:
import Component from '@glimmer/component';
import { TaskGenerator, TaskInstance } from…

Andrew Zaw
- 754
- 1
- 9
- 16
0
votes
2 answers
Run Ember.run.later from action triggered
I am having a problem with action handling in Ember controller. I want to run some function continuously after edit button is clicked in hbs. I have tried it like this in action.
openEditWindow() {
this.set('someChangingValue', true);
},
Here is…

Ramix
- 41
- 8