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

Promise support #65

Open
kinday opened this issue Apr 26, 2016 · 2 comments
Open

Promise support #65

kinday opened this issue Apr 26, 2016 · 2 comments

Comments

@kinday
Copy link

kinday commented Apr 26, 2016

Hey, I’d like to use async-props in my current project, but it lacks Promise support. How about mixing new and old school, huh?

If you like the idea, I’m willing to implement this feature myself.

@nelix
Copy link

nelix commented Sep 13, 2016

static loadProps(params, cb) {
    Promise.resolve({ilike: 'turtles'}).then(cb);
}

@Wildhoney
Copy link

@kinday please do – I'd much rather Promise support than the old-fashioned callback approach. We could then go a step further with allowing static async function:

static async loadProps(params) {
    
    const user = await getUser(params.user);
    const photos = await getPhotos(user);
    
    return { user, photos };
    
}

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

3 participants