Comments (6)
@Luiz-N I'm sorry it's taken me so long to respond.
I suppose that's a good idea given how many people use ember-route-action-helper.
One reason I've hesitated on something like this is that it's already a lot easier to pass tasks around than it is to pass actions around (you can just pass a reference to the task to the controller rather than have to use .bind()
or closures or something). But yeah, I'd consider something like this.
(hoping for some other feedback from people who also think it's a good idea)
from ember-concurrency.
I've created a quick PoC for a route-task
helper here: ember-route-task-helper
You can check out a demo here. The source code for the demo is the tests/dummy
app.
Give it a try and feel free to open issues for feedback! :)
from ember-concurrency.
In the example shown in the README, I use {{get (route-task "deleteUser") "isIdle"}}
, but I dislike this kind of syntax. I recommend using the {{with}}
helper:
Or even better, only use {{route-task}}
to pass tasks as attributes to components.
from ember-concurrency.
IMO, might be worth the wait to see the RFC for routable components first. In the previous one, I think they were also passing args to the route component similar to setupController
. So if we're still headed that way and not like the route-action
then at least there wouldn't be any wasted efforts.
from ember-concurrency.
I would really like to see this be a thing.
from ember-concurrency.
it's probably going to bite me down the road. But right now I'm giving this a try.
setupController() {
this._super(...arguments);
this.TASK.taskFn = this.TASK.taskFn.bind(this);
set(this.controller, 'TASK', this.TASK);
},
where TASK
is the concurrency task.
from ember-concurrency.
Related Issues (20)
- Use same types for return and arg HOT 2
- Plans for Ember 4.x migration HOT 1
- Not working in Ember 4.8+ HOT 3
- Ember 4.8 types preview issue HOT 1
- Decorators in JavaScript project HOT 1
- Typescript question for creating custom task modifiers HOT 1
- Docs code examples gone in the latest version
- Docs recommend using a private Ember API for test cleanup HOT 3
- 3.0.0 doesnโt include #512? HOT 2
- Perfrom helper in Typescript HOT 2
- Export types for helpers HOT 1
- Allow ember v5 in `peerDependencies`
- Usage in a V2 addon HOT 13
- Allow setting `cancelAll()` options on `{{cancel-all}}` helper
- Not working with ember-cli-babel 8.x HOT 2
- Babel issue with `ember-concurrency` 4.0.0 HOT 1
- Superfluous triple-slash directives generated by Glint produce Glint errors (manually removing them fixes this) HOT 5
- Having @glint/template as a non optional peer dependency causing type issues
- Instead of recommending, Ember.testing, we should use embroider/macros.
- Add 4.0.2 to Releases?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-concurrency.