Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@lastValue not assignable to parameter of type 'never' TypeScript error #44

Open
jonopus opened this issue Apr 16, 2019 · 1 comment
Open

Comments

@jonopus
Copy link

jonopus commented Apr 16, 2019

TS Definition not accepting
Argument of type '"someTask"' is not assignable to parameter of type 'never'.ts(2345)

import { on } from '@ember-decorators/object';
import { inject as service } from '@ember-decorators/service';
import Component from '@ember/component';
import { TaskInstance } from 'ember-concurrency';
import { lastValue, task } from 'ember-concurrency-decorators';
import StuffCollection from '../models/stuffs/stuff-collection';

export default class Thing extends Component {
  @service('store')
  store: any;

  @on('init')
  getProjects () {
    //@ts-ignore https://github.com/machty/ember-concurrency-decorators/issues/30
    this.getStuffTask.perform();
  }

  @task
  *getStuffTask(): IterableIterator<TaskInstance<Promise<StuffCollection>>> {
    const projects = yield this.store.queryRecord('stuff', {});
    return projects;
  }

  @lastValue('getStuffTask') // error here `Argument of type '"someTask"' is not assignable to parameter of type 'never'.ts(2345)`
  collection?: StuffCollection;
}
@buschtoens
Copy link
Collaborator

This should be fixed by the next beta release (1.0.0-beta.2).

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

No branches or pull requests

2 participants