You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Migrate callback logic to promise
- Add timeout option to throw an error if no response is returned
- Downgrade the Dropbox dependency to 7.0.0
- Add Upgrading.md for v2.0.0
* Add upgrading.md
This document shows you how to upgrade to the latest version of the popup, accomodating any breaking changes introduced by major version updates. If you find any issues with either this guide on upgrading or the changes introduced in the new version, please see file an issue.
4
+
5
+
# Upgrading from v1.X.X to v2.X.X
6
+
7
+
## Updating from callbacks to promises
8
+
9
+
We have updated the library to use the newer promises over callbacks. Previously this would have looked like this:
10
+
11
+
```
12
+
var popup = new DropboxPopup();
13
+
popup.authUser((auth) => {
14
+
// Do logic with auth
15
+
});
16
+
```
17
+
18
+
This now becomes:
19
+
20
+
```
21
+
var popup = new DropboxPopup();
22
+
popup.authUser().then((auth) => {
23
+
// Do logic with auth
24
+
}).catch((error) => {
25
+
// Handle Error
26
+
});
27
+
```
28
+
29
+
## Timeout Functionality
30
+
31
+
We have also added timeout functionality. When attempting to authenticate, we will timeout and throw an error if the request is not fulfilled in the time specified. The default is 5 minutes but can be configured to any time in milliseconds.
0 commit comments