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

Should Meteor.loginWithPassword have a promised-based alternative? #13068

Open
jamauro opened this issue Mar 21, 2024 · 3 comments
Open

Should Meteor.loginWithPassword have a promised-based alternative? #13068

jamauro opened this issue Mar 21, 2024 · 3 comments
Labels
Meteor 3 relates to Meteor 3
Milestone

Comments

@jamauro
Copy link
Contributor

jamauro commented Mar 21, 2024

With the move to async / await, I think mostly everything involving Accounts has a promise-based alternative with the *Async suffix, e.g. Accounts.createUserAsync. I noticed that Meteor.loginWithPassword is still callback-based only. Should it have a promise-based alternative?

IMO, it seems like it should since I imagine going forward people will be more comfortable writing all their Meteor code in a promise-based style. I suppose the workaround is making everyone write their own wrapper to promisify it which seems not great.

If y'all agree, there might be other methods that also should get a promise-based alternative. I didn't look at them all. I just happened to notice this one while porting a project to 3.0.

@matheusccastroo
Copy link
Contributor

I don't remember on which version it was added, but Meteor have the Meteor.promisify helper available in both client and server from what I remember, so we have an easy way to convert the callbacks to promise.

But agree, probably all methods that uses callback should have a promise alternative - which internally would just wrap the method with the promisify helper.

@harryadel
Copy link
Contributor

@StorytellerCZ Maybe mark it good first issue?

@Grubba27
Copy link
Contributor

I know that Meteor.promisify is only available in Meteor v3 versions.

Its docs are here btw

@StorytellerCZ StorytellerCZ added this to the Release 3.0 milestone Mar 25, 2024
@Grubba27 Grubba27 added the Meteor 3 relates to Meteor 3 label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meteor 3 relates to Meteor 3
Projects
None yet
Development

No branches or pull requests

5 participants