ember-concurrency
ember-concurrency copied to clipboard
Public TaskInstance and Task classes
Hello I need to check whether variable is instance of Task or TaskInstance but these are not public.
Currently I am accessing classes from private namespace, but its sort hacky.
import {Task} from 'ember-concurrency/-task-property';
import {TaskInstance} from 'ember-concurrency/-task-instance';
Is there a possibility to make them public or did I miss something?
@janmisek Just out of curiosity, what's the use case for checking this?
@machty I have altered Ember route model resolving using tasks. My augmentation is based on following article. https://engineering.linkedin.com/blog/2016/12/ember-concurrency--or--how-i-learned-to-stop-worrying-and-love-t
I did some universal solution and I want to do some assertions for developers convenience. This is our local solution until routable components arrives in Ember.
I also have a use case for this:
My generic search component is supplied a search task by its consumers (which in turn is called in an action using perform
), and I'd rather check that the supplied search task is an instance of Task than guess based on the presence or absence of a perform
method.