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 Uppy#close for tearing down an Uppy instance. #182

Merged
merged 7 commits into from
May 12, 2017
Prev Previous commit
Next Next commit
Add Uppy#close method, fixes #162
goto-bus-stop committed May 2, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a713922e725af0678af2f5aa06a9822e92ccdbd0
13 changes: 13 additions & 0 deletions src/core/Core.js
Original file line number Diff line number Diff line change
@@ -470,6 +470,19 @@ class Uppy {
}
}

/**
* Uninstall all plugins and close down this Uppy instance.
*/
close () {
this.iteratePlugins((plugin) => {
plugin.uninstall()
})

if (this.socket) {
this.socket.close()
}
}

/**
* Logs stuff to console, only if `debug` is set to true. Silent in production.
*