meteor/meteor

Should Meteor.loginWithPassword have a promised-based alternative?

jamauro opened this issue · 3 comments

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.

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.

@StorytellerCZ Maybe mark it good first issue?

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

Its docs are here btw