import { StoreRequestStateUpdater } from '../types/store-request-state-updater' ; export function getUrlWithParams ( url , params ) { Object . keys ( params ) . forEach ( key => { const value = params [ key ] ; url = url . replace ( `:${ key }` , value ) ; } ) ; return url ; } export function getStoreRequestStateUpdater ( store ) { return ( requestName , requestState ) => { store . setState ( { ... store . state , requests : { ... store . state . requests , [ requestName ] : requestState , } , } ) ; } ; }