briarsweetbriar / ember-progress-bar

An Ember.js wrapper and component for ProgressBar.js
MIT License
9 stars 12 forks source link

PR for exposing the 'set' functionality of ProgressBarJS #7

Closed robert-j-webb closed 6 years ago

robert-j-webb commented 6 years ago

Hi, would you be interested in a PR that makes it so you can call the 'set' function on the progress bar before the animate function? Here's the code I wrote for it:

didRender(...args) {
    this._super(...args);

    const { progressBar, progress, setProgress } = getProperties(
      this,
      'progressBar',
      'progress',
      'setProgress'
    );

    if (isPresent(setProgress)) {
      progressBar.set(setProgress);
    }

    progressBar.animate(progress, () => this.sendAction('onAnimationComplete'));
  },

I'd write a test for it!

briarsweetbriar commented 6 years ago

Sure!

On Thu, Mar 15, 2018, 4:25 PM Robert Webb notifications@github.com wrote:

Hi, would you be interested in a PR that makes it so you can call the 'set' function on the progress bar before the animate function? Here's the code I wrote for it:

didRender(...args) { this._super(...args);

const { progressBar, progress, setProgress } = getProperties(
  this,
  'progressBar',
  'progress',
  'setProgress'
);

if (isPresent(setProgress)) {
  progressBar.set(setProgress);
}

progressBar.animate(progress, () => this.sendAction('onAnimationComplete'));

},

I'd write a test for it!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/patience-tema-baron/ember-progress-bar/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/ACk2SJz9UbRwjeA4gx-T2O_PFsBgKEb0ks5tes5RgaJpZM4Ss1E8 .

briarsweetbriar commented 6 years ago

Thanks for the PR! Just released this under 1.0.0.