@@ -3,7 +3,7 @@ import safeGet from 'safe-get'
33import 'whatwg-fetch'
44
55// wpGet just wraps some of the basic fetch boilerplate
6- const wpGet = function ( { url, mapper, fetchOptions } ) {
6+ const wpGet = function ( { url, mapper, fetchOptions, errorCallback } ) {
77 return fetch ( url , fetchOptions )
88 . then ( res => {
99 if ( ! res . ok ) {
@@ -28,7 +28,7 @@ export default {
2828 * @param {object } fetchOptions - An object that contains options for the fetch call. See https://github.github.io/fetch/ for more
2929 * informaiton. NOTE: Must set {credentials: 'include' | 'same-site'} for endpoints requiring cookie authentication.
3030 */
31- createWpLoader ( url , options , fetchOptions ) {
31+ createWpLoader ( url , options , fetchOptions , errorCallback ) {
3232 let mapper = options . mapper ? options . mapper : this . mapPosts
3333 url += options . embed !== false ? '?_embed&' : '?'
3434 if ( safeGet ( options , 'queryParams.length' ) > 0 ) {
@@ -42,7 +42,7 @@ export default {
4242 const pageToLoad = loader . pagesLoaded + 1
4343 const newPage = { loaded : false , content : [ ] }
4444 loader . pages . push ( newPage )
45- wpGet ( { url : url + 'page=' + pageToLoad , mapper, fetchOptions } ) . then ( content => {
45+ wpGet ( { url : url + 'page=' + pageToLoad , mapper, fetchOptions, errorCallback } ) . then ( content => {
4646 newPage . content = content
4747 newPage . loaded = true
4848 loader . pagesLoaded ++
0 commit comments