nl_tokens: for fetching any wp post data type ( works isomorphic )
pl_tokens: function fetchData ( url , type , conf , cb ) { let forUrl ; switch ( type ) { case 'categories' : forUrl = ` ${ url } ` ; break ; case 'post' : // single 'post' forUrl = ` ${ url } ` ; break ; default : // 'posts' - 12 allows complete rows when col number 1-4 forUrl = ` ${ url } ` ; } axios . get ( forUrl , { params : conf } ) . then ( ( response ) => { if ( response && response . data ) { var data = response . data ; var promises = [ ] ; if ( Array . isArray ( <mask> ) ) { // iterate array data data . forEach ( function ( item ) { if ( 'post' === type && item . featured_media ) { // for single post, if there is a featured_media, get it's url promises . push ( new Promise ( function ( resolve ) { axios . get ( ` ${ url } ${ item . featured_media } ` ) . then ( ( response ) => { if ( response && response . data ) { item . featured_mediaData = response . data ; } resolve ( ) ; } ) ; } ) ) ; } } ) ; } // return data Promise . all ( promises ) . then ( ( ) => cb ( null , data , response . headers ) ) ; } } ) ; }