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

Task is not a function #76

Closed
smashedtoatoms opened this issue Feb 28, 2017 · 3 comments
Closed

Task is not a function #76

smashedtoatoms opened this issue Feb 28, 2017 · 3 comments

Comments

@smashedtoatoms
Copy link

smashedtoatoms commented Feb 28, 2017

I can't use task without getting Task is not a function errors. I literally paste in the examples and they don't work.

Steps to reproduce

Just create the tests in a separate file and manually run them. You will get an error saying Task is not a function. I did download and run all of the source, and it worked fine. The tests are importing different tasks than the actual tasks.

Expected behaviour

I expect the Task to be the task instead of not a function.

Observed behaviour

I get Task is not a function

Environment

OS: MacOS
VM: js 4.3.2, 
Folktale: ^2.0.0-alpha2

Additional information

It's very likely I am doing something wrong, but I can't figure out what. This library rules, sorry to be a pain in the ass.

@smashedtoatoms
Copy link
Author

I just rolled my code back to 1.0 and it's working fine. I'm not sure if that helps or not.

@robotlolita
Copy link
Member

No worries, the issue tracker exists pretty much to help people getting the library to work :)

Can you give more information on what code you're running, and how you're running it? There are no examples of using Task (yet) in this repository ('sides #50), and the test files for Task can't be ran directly as they use Babel for some non-JS-ish transformations.

Ah, I should note that the Task implemented in this repository is not compatible with the Task defined in https://github.com/folktale/data.task#datatask, which is what you'd find in older blog posts and stuff. Older examples (using new Task((reject, resolve) => { ... })) are for the Data.Task (or Folktale 1). The new API (Folktale 2, in this repository) changed this a bit to provide better support for cancellation and resource lifecycles.

@smashedtoatoms
Copy link
Author

Hah, that’s WAY better. I was hoping the answer would be that I’m doing it wrong. That link to #50 is all I needed to get it working. That example is actually perfect for the docs. Thanks for your help.

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