MartinMalinda / vue-concurrency

A library for encapsulating asynchronous operations and managing concurrency for Vue and Composition API.
https://vue-concurrency.netlify.app/
MIT License
350 stars 15 forks source link

Export types like TaskInstance #46

Closed djmattyg007 closed 3 years ago

djmattyg007 commented 3 years ago

This will provide more flexibility when typing things.

MartinMalinda commented 3 years ago

They're exported but maybe not in root, I'll take a look.

So far this should work I think: (change vue3 to vue2 if needed):

import { Task } from "vue-concurrency/dist/vue3/src/Task";
import { TaskInstance } from "vue-concurrency/dist/vue3/src/TaskInstance";

I'll try to make this work:

import { Task, TaskInstance } from "vue-concurrency";
djmattyg007 commented 3 years ago

Importing from nested paths feels very clunky. It would definitely be easier if the relevant types were exported through the main entrypoint (something which typescript absolutely fully supports).

MartinMalinda commented 3 years ago

This should be fixed as part of 2.1.1

Screenshot 2021-07-18 at 12 18 51