File tree Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,22 @@ import fetch from 'isomorphic-fetch';
3
3
4
4
ES6Promise . polyfill ( ) ;
5
5
6
+ /**
7
+ * @method spread
8
+ * @description return the promise with the arguments.
9
+ * @example
10
+ * blogQuery.find().spread()
11
+ */
12
+ function spread ( ) {
13
+ if ( Promise . prototype . spread ) return ;
14
+ Promise . prototype . spread = function ( fn ) {
15
+ return this . then ( function ( args ) {
16
+ return fn . apply ( fn , args ) ;
17
+ } ) ;
18
+ } ;
19
+ }
20
+ if ( typeof Promise !== 'undefined' ) {
21
+ spread ( ) ;
22
+ }
23
+
6
24
export default fetch ;
Original file line number Diff line number Diff line change @@ -2,6 +2,22 @@ import ES6Promise from 'es6-promise';
2
2
import fetch from 'isomorphic-fetch' ;
3
3
4
4
ES6Promise . polyfill ( ) ;
5
-
5
+ /**
6
+ * @method spread
7
+ * @description return the promise with the arguments.
8
+ * @example
9
+ * blogQuery.find().spread()
10
+ */
11
+ function spread ( ) {
12
+ if ( Promise . prototype . spread ) return ;
13
+ Promise . prototype . spread = function ( fn ) {
14
+ return this . then ( function ( args ) {
15
+ return fn . apply ( fn , args ) ;
16
+ } ) ;
17
+ } ;
18
+ }
19
+ if ( typeof Promise !== 'undefined' ) {
20
+ spread ( ) ;
21
+ }
6
22
export default fetch ;
7
23
Original file line number Diff line number Diff line change @@ -2,5 +2,21 @@ import ES6Promise from 'es6-promise';
2
2
import fetch from 'isomorphic-fetch' ;
3
3
4
4
ES6Promise . polyfill ( ) ;
5
-
5
+ /**
6
+ * @method spread
7
+ * @description return the promise with the arguments.
8
+ * @example
9
+ * blogQuery.find().spread()
10
+ */
11
+ function spread ( ) {
12
+ if ( Promise . prototype . spread ) return ;
13
+ Promise . prototype . spread = function ( fn ) {
14
+ return this . then ( function ( args ) {
15
+ return fn . apply ( fn , args ) ;
16
+ } ) ;
17
+ } ;
18
+ }
19
+ if ( typeof Promise !== 'undefined' ) {
20
+ spread ( ) ;
21
+ }
6
22
export default fetch ;
You can’t perform that action at this time.
0 commit comments