export const urlWithQueryParams = ( url , queryParams ) => { return Object . entries ( queryParams ) . reduce ( ( total , current , ind , arr ) => { if ( ind === 0 ) total += '?' ; total += current . join ( '=' ) ; if ( ind !== arr . length - 1 ) total += '&' ; return total ; } , url ) ; } ;