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

Does Neode.create<T>(...) async? #162

Open
kingpeti opened this issue Sep 26, 2021 · 8 comments
Open

Does Neode.create<T>(...) async? #162

kingpeti opened this issue Sep 26, 2021 · 8 comments

Comments

@kingpeti
Copy link

when using this method it is not working as defined in TS. But when I use async-await everything is fine and the return value from Neode.create<T>(...) is present.
To work as expected I think it needs to wrap in promise.

Neode.create<T>(model: string, properties: object): Promise<Neode.Node<T>>;

Am I Correct?

@Aqua-4
Copy link

Aqua-4 commented Feb 23, 2022

Yes

@LucaProvencal
Copy link

LucaProvencal commented Mar 5, 2022

It's in the source: https://github.com/adam-cowley/neode/blob/master/types/index.d.ts#L84, but for some reason when I npm install neode@latest, the line is

create<T>(model: string, properties: object): Neode.Node<T>;

@adam-cowley do you have any ideas? Thanks!

@adam-cowley
Copy link
Owner

adam-cowley commented Mar 7, 2022

The create service does return a Promise so I get the feeling that neode@latest might not actually be the latest. Could you try version 0.4.7?

@LucaProvencal
Copy link

LucaProvencal commented Mar 7, 2022

Thanks for the reply. That's the version it installed. The same thing happens with npm install [email protected].

@adam-cowley
Copy link
Owner

I have just tried on codesandbox and it seems fine to me. Is it just the code hinting/intellisense that is out of date or is the code failing?

https://codesandbox.io/s/bold-blackburn-5088nm?file=/index.js

@LucaProvencal
Copy link

LucaProvencal commented Mar 7, 2022

The code works fine without TypeScript. TypeScript compiler throws an error when it shouldn't since the line should be

Neode.create<T>(model: string, properties: object): Promise<Neode.Node<T>>;

instead of

Neode.create<T>(model: string, properties: object): Neode.Node<T>;.

I think it is some problem with the 0.4.7 distribution on NPM. The code doesn't match what is in the repo.

@adam-cowley
Copy link
Owner

I have just bumped the version number and republished, so hopefully version 0.4.8 will fix the problem.

@LucaProvencal
Copy link

@adam-cowley That worked! Thanks. Don't want to speak for @kingpeti but I think we can close this

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

4 participants