Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

BoussonKarel
Copy link
Contributor

@BoussonKarel BoussonKarel commented Sep 18, 2024

trackedFunction has a retry option, but the trackedTask doesn't have this (yet).

Here is an attempt at adding retry to the trackedTask.

Copy link

vercel bot commented Sep 18, 2024

@BoussonKarel is attempting to deploy a commit to the universal-ember Team on Vercel.

A member of the Team first needs to authorize it.


[RUN] = (positional: Args) => {
[RUN] = () => {
let args = this[THUNK] || DEFAULT_THUNK;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of doing this[THUNK] || DEFAULT_THUNK here, could we move it to the constructor.

this way, we can access the args directly in here (still invoking normalizeThunk as you have it though).

registerDestructor(state, () => state[TASK].cancelAll());

return destroyable as unknown as TaskInstance<Return>;
return destroyable as unknown as TaskInstance<Return> & { retry: () => void };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know in discord you said you might want to do the type differently -- but I think this is fine <3

assert.false(foo.search.isRunning);
});

test('it runs again when calling retry()', async function (assert) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a testing technique that might help here (and/or in a rendering test)
is using assert.step('name of thing') and then at various intervals calling assert.verifySteps([expected steps]) -- this way you don't necessarily need to be concerned with the exact values if you don't need to be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.