File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { getInitialStatus , getIdleStatus , getStatusProps , statusTypes } from "./status"
2
2
3
3
// This exists to make sure we don't hold any references to user-provided functions
4
- class NeverSettle extends Promise {
5
- constructor ( ) {
6
- super ( ( ) => { } , ( ) => { } )
7
- /* istanbul ignore next */
8
- if ( Object . setPrototypeOf ) {
9
- // Not available in IE 10, but can be polyfilled
10
- Object . setPrototypeOf ( this , NeverSettle . prototype )
11
- }
12
- }
4
+ function NeverSettle ( ) { }
5
+ /* istanbul ignore next */
6
+ if ( Object . setPrototypeOf ) {
7
+ // Not available in IE 10, but can be polyfilled
8
+ Object . setPrototypeOf ( NeverSettle , Promise )
9
+ }
10
+ NeverSettle . prototype = Object . assign ( Object . create ( Promise . prototype ) , {
13
11
finally ( ) {
14
12
return this
15
- }
13
+ } ,
16
14
catch ( ) {
17
15
return this
18
- }
16
+ } ,
19
17
then ( ) {
20
18
return this
21
- }
22
- }
19
+ } ,
20
+ } )
23
21
24
22
export const neverSettle = new NeverSettle ( )
25
23
You can’t perform that action at this time.
0 commit comments