add (task) helper to pass in curried tasks
See original GitHub issuePresently the perform
template helper essentially produces a closure action so that you can pass a task (w curried args) into a component and have it be invoked upon sendAction
or this.attrs.actionName()
. It seems desirable to be able to pass in a Task with curried args so that there’s feature parity w closure actions, and components maintain the ability to stylize themselves according to the isRunning state of the task.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Curry and Function Composition - Medium
So what we'll need to do instead is call a function that returns a function. Create a function that increments whatever number you...
Read more >Understanding JavaScript currying - LogRocket Blog
In this example, we are going to create a simple curry function where a user sends a friend request to his friend John:...
Read more >Add or edit a task - Android - Google Tasks Help
Create a task · Open the Google Tasks app Tasks . · Tap Add task . · Enter a title. · Optional: To...
Read more >Make a To-Do List That Works: The Right Way to Get Sh!t Done
Some people might find that adding different colors for different types of tasks might help the routine stick. Others go the whiteboard or ......
Read more >Create tasks and to-do items - Microsoft Support
Select New Items > Task or press Ctrl+Shift+K. In the Subject box, enter a name for the task. It's best to keep the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is what you want (though you might want to rename some things):
The
perform
helper produces a regular ol function that’s compatible with APIs expecting you to pass in closure actions / functions. The way you had it, you were basically doing a lookup ofisRunning
on a function, rather than a task. If you’re writing a component that is task-aware, you can just pass in the task directly, and then callperform
on the task from within the component’s template.(task)
has now been implemented and released in 0.6.0, as is support forvalue="..."
; there is an example for value=“” at the bottom of http://ember-concurrency.com/#/docs/writing-tasks