Comments (7)
I think this is what you want (though you might want to rename some things):
// template
{{search-input on-input=search}}
// component
<input type="text" value={{query}} oninput={{perform on-input value="target.value"}}>
{{if (get on-input 'isRunning') "never true"}}
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 of isRunning
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 call perform
on the task from within the component's template.
from ember-concurrency.
Would be nice, status on this?
from ember-concurrency.
@Padchi still thinking through some ideas about whether this should be task-helper specific or whether in JS it should be easy to create tasks that are curried versions of other tasks.
from ember-concurrency.
I don't think this was my problem tho. I just want to pass down a task to a component, perform it from the component and be able to to see if it's running or not. Maybe I'm doing something wrong but isRunning is undefined:
// template
{{search-input on-input=(perform search)}}
// component
<input type="text" value={{query}} oninput={{action on-input value="target.value"}}>
{{if (get on-input 'isRunning') "never true"}}
Skickat från min iPhone
20 mars 2016 kl. 05:59 skrev Alex Matchneer [email protected]:
@Padchi still thinking through some ideas about whether this should be task-helper specific or whether in JS it should be easy to create tasks that are curried versions of other tasks.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
from ember-concurrency.
Well that work's except that the value that is passed to the task is the whole oninput event:
Event {isTrusted: true, type: "input", target: input, currentTarget: input, eventPhase: 2…}
from ember-concurrency.
@Padchi I believe that's fixed on master but I still need to cut a release :/ will try and get that out soon.
from ember-concurrency.
(task)
has now been implemented and released in 0.6.0, as is support for value="..."
; there is an example for value="" at the bottom of http://ember-concurrency.com/#/docs/writing-tasks
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.