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';
33
44ES6Promise . polyfill ( ) ;
55
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+
624export default fetch ;
Original file line number Diff line number Diff line change @@ -2,6 +2,22 @@ import ES6Promise from 'es6-promise';
22import fetch from 'isomorphic-fetch' ;
33
44ES6Promise . 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+ }
622export default fetch ;
723
Original file line number Diff line number Diff line change @@ -2,5 +2,21 @@ import ES6Promise from 'es6-promise';
22import fetch from 'isomorphic-fetch' ;
33
44ES6Promise . 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+ }
622export default fetch ;
You can’t perform that action at this time.
0 commit comments