an attempt at adding retry() to trackedTask#119
an attempt at adding retry() to trackedTask#119BoussonKarel wants to merge 1 commit intouniversal-ember:mainfrom
Conversation
|
@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; |
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
trackedFunction has a
retryoption, but the trackedTask doesn't have this (yet).Here is an attempt at adding retry to the trackedTask.