@@ -448,7 +489,12 @@ import { Poll } from "restful-react"
Below is a more convoluted example that employs nearly the full power of the `Poll` component.
```jsx
-
response && response.ok} interval={0} lazy>
+ response && response.ok}
+ interval={0}
+ lazy
+>
{(_, { loading, error, finished, polling }, { start }) => {
return loading ? (
@@ -473,7 +519,7 @@ Below is a more convoluted example that employs nearly the full power of the `Po
```
-Note from the previous example, `Poll` also exposes more states: `finished`, and `polling` that allow better flow control, as well as lazy-start polls that can also be programatically stopped at a later stage.
+Note from the previous example, `Poll` also exposes more states: `finished`, and `polling` that allow better flow control, as well as lazy-start polls that can also be programmatically stopped at a later stage.
#### Long Polling
@@ -600,14 +646,14 @@ module.exports = inputSchema => ({
(pathItemMem, [verb, operation]) => ({
...pathItemMem,
[verb]: {
- ...fixOperationId(path, verb, operation),
- },
+ ...fixOperationId(path, verb, operation)
+ }
}),
- {},
- ),
+ {}
+ )
}),
- {},
- ),
+ {}
+ )
});
```
@@ -649,17 +695,17 @@ module.exports = {
output: "src/queries/myFirstBackend.tsx",
file: "specs/my-first-backend.yaml",
customProps: {
- base: `"http://my-first-backend.com"`,
- },
+ base: `"http://my-first-backend.com"`
+ }
},
configurableBackend: {
output: "src/queries/configurableBackend.tsx",
github: "contiamo:restful-react:master:docs/swagger.json",
customImport: `import { getConfig } from "../components/Config.tsx";`,
customProps: {
- base: `{getConfig("backendBasePath")}`,
- },
- },
+ base: `{getConfig("backendBasePath")}`
+ }
+ }
};
```
diff --git a/src/Context.tsx b/src/Context.tsx
index e34e5a94..5bdaca25 100644
--- a/src/Context.tsx
+++ b/src/Context.tsx
@@ -32,6 +32,10 @@ export interface RestfulReactProviderProps {
* **Warning:** it's probably not a good idea to put API keys here. Consider headers instead.
*/
queryParams?: { [key: string]: any };
+ /*
+ * Allows to obtain the Provider and/or the Consumer name
+ */
+ displayName?: String;
}
export const Context = React.createContext>({
@@ -41,6 +45,7 @@ export const Context = React.createContext>(
requestOptions: {},
onError: noop,
queryParams: {},
+ displayName: "",
});
export interface InjectedProps {
@@ -58,6 +63,7 @@ export default class RestfulReactProvider extends React.Component