Skip to content

Conversation

@johanrd
Copy link
Contributor

@johanrd johanrd commented May 7, 2025

Type support for case where ember-concurrency task.perform is set as the search function.

restartableTask<unknown, (term: string) => Promise>(asyncArrowTaskFn: (term: string) => Promise): TaskForAsyncTaskFunction<unknown, (term: string) => Promise> (+4 overloads)

updateSearch = restartableTask(async (term: string) => {
  await timeout(250)
  this.router.transitionTo({ queryParams: { search: term } })
})
<PowerSelect
  @search={{this.updateSearch.perform}}
/>

Type support for case where ember-concurrency task.perform is set as the search function.

restartableTask<unknown, (term: string) => Promise<void>>(asyncArrowTaskFn: (term: string) => Promise<void>): TaskForAsyncTaskFunction<unknown, (term: string) => Promise<void>> (+4 overloads)


```
updateSearch = restartableTask(async (term: string) => {
    await timeout(250)
    this.router.transitionTo({ queryParams: { projectQuery: term } })
  })

<PowerSelect
@search={{this.updateSearch.perform}}
/>
```
@johanrd
Copy link
Contributor Author

johanrd commented May 7, 2025

okay, i see the integration tests fail. Not sure how to deal with that atm, as the search action may not return anything itself, if just writing reactive state to the url.

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.

1 participant