@everymatrix/retail-helpers
v1.21.38
Published
2 params : - src: string - config = { cancelabe: boolean requiresHeaders: boolean } if config.cancelable is true everytime a new request (of this type) is created all the old ones are canceled. --- Note: request cancel only h
Downloads
55
Maintainers
Keywords
Readme
getData
2 params :
- src: string
- config = { cancelabe: boolean requiresHeaders: boolean } if config.cancelable is true everytime a new request (of this type) is created all the old ones are canceled. --- Note: request cancel only happens in browser, the request is still processed by the server but you won't get a response from it. if config.requresHeaders is true then the request will wait for window.postMessage with type: SetAuthHeaders, and payload being an HeadersInit type object.
returns an array that contains [data, error]
example getData
const [data, error] = await getData(`${src}/profile`, {requiresHeaders: true, cancelabe: true})