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

Return a promise instead of using a callback #59

Open
alexqbm opened this issue Nov 27, 2020 · 0 comments
Open

Return a promise instead of using a callback #59

alexqbm opened this issue Nov 27, 2020 · 0 comments

Comments

@alexqbm
Copy link

alexqbm commented Nov 27, 2020

Hi. I would like to know if it'd be possible to return a promise when using the write function instead of having to pass a callback to it.

Instead of:

const ye = this.myModel.write(options, shapeStream, (err, file) => {})

where ye ends up being undefined since myModel.write does not return anything, I would like to do:

const ye = this.myModel.write(options, shapeStream);
ye.then((file) => {}).catch((err) => {});

Is this possible?

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

1 participant