Skip to content

Commit 02f63c0

Browse files
committed
preserve Transition.prototype.constructor
1 parent 7ee1a22 commit 02f63c0

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

modules/utils/Transition.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,21 @@ function Transition(routesComponent, path) {
1414
this.isAborted = false;
1515
}
1616

17-
Transition.prototype = {
18-
19-
abort: function (reason) {
20-
this.abortReason = reason;
21-
this.isAborted = true;
22-
},
23-
24-
redirect: function (to, params, query) {
25-
this.abort(new Redirect(to, params, query));
26-
},
17+
Transition.prototype.abort = function (reason) {
18+
this.abortReason = reason;
19+
this.isAborted = true;
20+
};
2721

28-
wait: function (value) {
29-
this.promise = Promise.resolve(value);
30-
},
22+
Transition.prototype.redirect = function (to, params, query) {
23+
this.abort(new Redirect(to, params, query));
24+
};
3125

32-
retry: function () {
33-
this.routesComponent.replaceWith(this.path);
34-
}
26+
Transition.prototype.wait = function (value) {
27+
this.promise = Promise.resolve(value);
28+
};
3529

30+
Transition.prototype.retry = function () {
31+
this.routesComponent.replaceWith(this.path);
3632
};
3733

3834
module.exports = Transition;

0 commit comments

Comments
 (0)