@faasjs/react 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -206,7 +206,12 @@ function FaasReactClient({
206
206
  }
207
207
  function getClient(domain) {
208
208
  const client = clients[domain || Object.keys(clients)[0]];
209
- if (!client) throw Error("FaasReactClient is not initialized");
209
+ if (!client) {
210
+ console.warn("FaasReactClient is not initialized manually, use default.");
211
+ return FaasReactClient({
212
+ domain: ""
213
+ });
214
+ }
210
215
  return client;
211
216
  }
212
217
  async function faas(action, params) {
package/dist/index.mjs CHANGED
@@ -204,7 +204,12 @@ function FaasReactClient({
204
204
  }
205
205
  function getClient(domain) {
206
206
  const client = clients[domain || Object.keys(clients)[0]];
207
- if (!client) throw Error("FaasReactClient is not initialized");
207
+ if (!client) {
208
+ console.warn("FaasReactClient is not initialized manually, use default.");
209
+ return FaasReactClient({
210
+ domain: ""
211
+ });
212
+ }
208
213
  return client;
209
214
  }
210
215
  async function faas(action, params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/react",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@faasjs/browser": "2.5.0"
25
+ "@faasjs/browser": "2.5.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "*"