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

Add the ability to send a promise as an option to spinnies #3

Open
jcarpanelli opened this issue Jun 4, 2019 · 0 comments
Open

Add the ability to send a promise as an option to spinnies #3

jcarpanelli opened this issue Jun 4, 2019 · 0 comments

Comments

@jcarpanelli
Copy link
Owner

@jcarpanelli jcarpanelli commented Jun 4, 2019

Instead of setting a spinner as succeed/fail using the spinners#fail and spinner#succeed methods, it would be great if spinnies could do this automatically when sending a promise as an option:

spinnies.add('spinner-1', { 
  text: 'Doing X..',
  onPromise: {
    promise: someFunction(arg1, arg2), 
    succeed: { 
      text: 'X succeeded',
      color: 'greenBright'
    },
    fail: {
      ...
    } 
});
@jcarpanelli jcarpanelli changed the title Add the ability to send a promise as option to a spinner Add the ability to send a promise as an option to spinnies Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.