@faasjs/react 0.0.4-beta.10 → 0.0.4-beta.12

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/README.md CHANGED
@@ -35,6 +35,7 @@ React plugin for FaasJS.
35
35
  - [FaasReactClientInstance](#faasreactclientinstance)
36
36
  - [Options](#options)
37
37
  - [ResponseHeaders](#responseheaders)
38
+ - [SignalOptions](#signaloptions)
38
39
  - [useFaasOptions](#usefaasoptions)
39
40
 
40
41
  ### Functions
@@ -43,6 +44,7 @@ React plugin for FaasJS.
43
44
  - [FaasReactClient](#faasreactclient)
44
45
  - [faas](#faas)
45
46
  - [getClient](#getclient)
47
+ - [signal](#signal)
46
48
  - [useFaas](#usefaas)
47
49
 
48
50
  ## Type Aliases
@@ -64,13 +66,13 @@ ___
64
66
 
65
67
  ### FaasAction
66
68
 
67
- Ƭ **FaasAction**: `FaasActionPaths` \| `Record`<`string`, `any`\>
69
+ Ƭ **FaasAction**: `FaasActionPaths` \| `Record`\<`string`, `any`\>
68
70
 
69
71
  ___
70
72
 
71
73
  ### FaasData
72
74
 
73
- Ƭ **FaasData**<`T`\>: `T` extends `FaasActionPaths` ? `FaasActions`[`T`][``"Data"``] : `T`
75
+ Ƭ **FaasData**\<`T`\>: `T` extends `FaasActionPaths` ? `FaasActions`[`T`][``"Data"``] : `T`
74
76
 
75
77
  #### Type parameters
76
78
 
@@ -82,7 +84,7 @@ ___
82
84
 
83
85
  ### FaasDataInjection
84
86
 
85
- Ƭ **FaasDataInjection**<`Data`\>: `Object`
87
+ Ƭ **FaasDataInjection**\<`Data`\>: `Object`
86
88
 
87
89
  Injects FaasData props.
88
90
 
@@ -100,20 +102,20 @@ Injects FaasData props.
100
102
  | `data` | `Data` |
101
103
  | `error` | `any` |
102
104
  | `loading` | `boolean` |
103
- | `params` | `Record`<`string`, `any`\> |
104
- | `promise` | `Promise`<`Response`<`Data`\>\> |
105
+ | `params` | `Record`\<`string`, `any`\> |
106
+ | `promise` | `Promise`\<`Response`\<`Data`\>\> |
105
107
  | `reloadTimes` | `number` |
106
- | `setData` | `React.Dispatch`<`React.SetStateAction`<`Data`\>\> |
107
- | `setError` | `React.Dispatch`<`React.SetStateAction`<`any`\>\> |
108
- | `setLoading` | `React.Dispatch`<`React.SetStateAction`<`boolean`\>\> |
109
- | `setPromise` | `React.Dispatch`<`React.SetStateAction`<`Promise`<`Response`<`Data`\>\>\>\> |
110
- | `reload` | (`params?`: `Record`<`string`, `any`\>) => `Promise`<`any`\> |
108
+ | `setData` | `React.Dispatch`\<`React.SetStateAction`\<`Data`\>\> |
109
+ | `setError` | `React.Dispatch`\<`React.SetStateAction`\<`any`\>\> |
110
+ | `setLoading` | `React.Dispatch`\<`React.SetStateAction`\<`boolean`\>\> |
111
+ | `setPromise` | `React.Dispatch`\<`React.SetStateAction`\<`Promise`\<`Response`\<`Data`\>\>\>\> |
112
+ | `reload` | (`params?`: `Record`\<`string`, `any`\>) => `Promise`\<`any`\> |
111
113
 
112
114
  ___
113
115
 
114
116
  ### FaasDataWrapperProps
115
117
 
116
- Ƭ **FaasDataWrapperProps**<`PathOrData`\>: `Object`
118
+ Ƭ **FaasDataWrapperProps**\<`PathOrData`\>: `Object`
117
119
 
118
120
  #### Type parameters
119
121
 
@@ -126,19 +128,19 @@ ___
126
128
  | Name | Type | Description |
127
129
  | :------ | :------ | :------ |
128
130
  | `action` | `string` | - |
129
- | `children?` | `React.ReactElement`<`Partial`<[`FaasDataInjection`](#faasdatainjection)\>\> | - |
130
- | `data?` | `FaasData`<`PathOrData`\> | use custom data, should work with setData |
131
+ | `children?` | `React.ReactElement`\<`Partial`\<[`FaasDataInjection`](#faasdatainjection)\>\> | - |
132
+ | `data?` | `FaasData`\<`PathOrData`\> | use custom data, should work with setData |
131
133
  | `fallback?` | `JSX.Element` \| ``false`` | - |
132
- | `params?` | `FaasParams`<`PathOrData`\> | - |
133
- | `setData?` | `React.Dispatch`<`React.SetStateAction`<`FaasData`<`PathOrData`\>\>\> | use custom setData, should work with data |
134
- | `onDataChange?` | (`args`: [`FaasDataInjection`](#faasdatainjection)<`FaasData`<`PathOrData`\>\>) => `void` | - |
135
- | `render?` | (`args`: [`FaasDataInjection`](#faasdatainjection)<`FaasData`<`PathOrData`\>\>) => `Element` \| `Element`[] | - |
134
+ | `params?` | `FaasParams`\<`PathOrData`\> | - |
135
+ | `setData?` | `React.Dispatch`\<`React.SetStateAction`\<`FaasData`\<`PathOrData`\>\>\> | use custom setData, should work with data |
136
+ | `onDataChange?` | (`args`: [`FaasDataInjection`](#faasdatainjection)\<`FaasData`\<`PathOrData`\>\>) => `void` | - |
137
+ | `render?` | (`args`: [`FaasDataInjection`](#faasdatainjection)\<`FaasData`\<`PathOrData`\>\>) => `Element` \| `Element`[] | - |
136
138
 
137
139
  ___
138
140
 
139
141
  ### FaasParams
140
142
 
141
- Ƭ **FaasParams**<`T`\>: `T` extends `FaasActionPaths` ? `FaasActions`[`T`][``"Params"``] : `any`
143
+ Ƭ **FaasParams**\<`T`\>: `T` extends `FaasActionPaths` ? `FaasActions`[`T`][``"Params"``] : `any`
142
144
 
143
145
  #### Type parameters
144
146
 
@@ -156,20 +158,20 @@ ___
156
158
 
157
159
  | Name | Type |
158
160
  | :------ | :------ |
159
- | `faas` | <PathOrData\>(`action`: `string` \| `PathOrData`, `params`: `FaasParams`<`PathOrData`\>) => `Promise`<`Response`<`FaasData`<`PathOrData`\>\>\> |
161
+ | `faas` | \<PathOrData\>(`action`: `string` \| `PathOrData`, `params`: `FaasParams`\<`PathOrData`\>) => `Promise`\<`Response`\<`FaasData`\<`PathOrData`\>\>\> |
160
162
  | `id` | `string` |
161
- | `useFaas` | <PathOrData\>(`action`: `string` \| `PathOrData`, `defaultParams`: `FaasParams`<`PathOrData`\>, `options?`: [`useFaasOptions`](#usefaasoptions)<`PathOrData`\>) => [`FaasDataInjection`](#faasdatainjection)<`FaasData`<`PathOrData`\>\> |
162
- | `FaasDataWrapper` | <PathOrData\>(`props`: [`FaasDataWrapperProps`](#faasdatawrapperprops)<`PathOrData`\>) => `Element` |
163
+ | `useFaas` | \<PathOrData\>(`action`: `string` \| `PathOrData`, `defaultParams`: `FaasParams`\<`PathOrData`\>, `options?`: [`useFaasOptions`](#usefaasoptions)\<`PathOrData`\>) => [`FaasDataInjection`](#faasdatainjection)\<`FaasData`\<`PathOrData`\>\> |
164
+ | `FaasDataWrapper` | \<PathOrData\>(`props`: [`FaasDataWrapperProps`](#faasdatawrapperprops)\<`PathOrData`\>) => `Element` |
163
165
 
164
166
  ___
165
167
 
166
168
  ### Options
167
169
 
168
- Ƭ **Options**: `RequestInit` & { `beforeRequest?`: (`{
170
+ Ƭ **Options**: `RequestInit` & \{ `beforeRequest?`: (`{
169
171
  action,
170
172
  params,
171
173
  options,
172
- }`: { `action`: `string` ; `options`: [`Options`](#options) ; `params`: `Record`<`string`, `any`\> }) => `Promise`<`void`\> \| `void` ; `headers?`: { `[key: string]`: `string`; } ; `request?`: <PathOrData\>(`url`: `string`, `options`: [`Options`](#options)) => `Promise`<[`Response`](classes/Response.md)<[`FaasData`](#faasdata)<`PathOrData`\>\>\> }
174
+ }`: \{ `action`: `string` ; `options`: [`Options`](#options) ; `params`: `Record`\<`string`, `any`\> }) => `Promise`\<`void`\> ; `headers?`: \{ `[key: string]`: `string`; } ; `request?`: \<PathOrData\>(`url`: `string`, `options`: [`Options`](#options)) => `Promise`\<[`Response`](classes/Response.md)\<[`FaasData`](#faasdata)\<`PathOrData`\>\>\> }
173
175
 
174
176
  ___
175
177
 
@@ -183,9 +185,21 @@ ___
183
185
 
184
186
  ___
185
187
 
188
+ ### SignalOptions
189
+
190
+ Ƭ **SignalOptions**: `Object`
191
+
192
+ #### Type declaration
193
+
194
+ | Name | Type |
195
+ | :------ | :------ |
196
+ | `debugName?` | `string` |
197
+
198
+ ___
199
+
186
200
  ### useFaasOptions
187
201
 
188
- Ƭ **useFaasOptions**<`PathOrData`\>: `Object`
202
+ Ƭ **useFaasOptions**\<`PathOrData`\>: `Object`
189
203
 
190
204
  #### Type parameters
191
205
 
@@ -197,17 +211,17 @@ ___
197
211
 
198
212
  | Name | Type | Description |
199
213
  | :------ | :------ | :------ |
200
- | `data?` | `FaasData`<`PathOrData`\> | - |
214
+ | `data?` | `FaasData`\<`PathOrData`\> | - |
201
215
  | `debounce?` | `number` | send the last request after milliseconds |
202
- | `params?` | `FaasParams`<`PathOrData`\> | - |
203
- | `setData?` | `React.Dispatch`<`React.SetStateAction`<`FaasData`<`PathOrData`\>\>\> | - |
204
- | `skip?` | `boolean` \| (`params`: `FaasParams`<`PathOrData`\>) => `boolean` | if skip is true, will not send request |
216
+ | `params?` | `FaasParams`\<`PathOrData`\> | - |
217
+ | `setData?` | `React.Dispatch`\<`React.SetStateAction`\<`FaasData`\<`PathOrData`\>\>\> | - |
218
+ | `skip?` | `boolean` \| (`params`: `FaasParams`\<`PathOrData`\>) => `boolean` | if skip is true, will not send request |
205
219
 
206
220
  ## Functions
207
221
 
208
222
  ### FaasDataWrapper
209
223
 
210
- ▸ **FaasDataWrapper**<`PathOrData`\>(`props`): `JSX.Element`
224
+ ▸ **FaasDataWrapper**\<`PathOrData`\>(`props`): `JSX.Element`
211
225
 
212
226
  A data wrapper for react components
213
227
 
@@ -215,13 +229,13 @@ A data wrapper for react components
215
229
 
216
230
  | Name | Type |
217
231
  | :------ | :------ |
218
- | `PathOrData` | extends `Record`<`string`, `any`\> |
232
+ | `PathOrData` | extends `Record`\<`string`, `any`\> |
219
233
 
220
234
  #### Parameters
221
235
 
222
236
  | Name | Type |
223
237
  | :------ | :------ |
224
- | `props` | [`FaasDataWrapperProps`](#faasdatawrapperprops)<`PathOrData`\> |
238
+ | `props` | [`FaasDataWrapperProps`](#faasdatawrapperprops)\<`PathOrData`\> |
225
239
 
226
240
  #### Returns
227
241
 
@@ -252,7 +266,7 @@ Before use faas, you should initialize a FaasReactClient.
252
266
  | :------ | :------ |
253
267
  | `«destructured»` | `Object` |
254
268
  | › `domain` | `string` |
255
- | › `onError?` | (`action`: `string`, `params`: `Record`<`string`, `any`\>) => (`res`: [`ResponseError`](classes/ResponseError.md)) => `Promise`<`void`\> |
269
+ | › `onError?` | (`action`: `string`, `params`: `Record`\<`string`, `any`\>) => (`res`: [`ResponseError`](classes/ResponseError.md)) => `Promise`\<`void`\> |
256
270
  | › `options?` | [`Options`](#options) |
257
271
 
258
272
  #### Returns
@@ -269,7 +283,7 @@ ___
269
283
 
270
284
  ### faas
271
285
 
272
- ▸ **faas**<`PathOrData`\>(`action`, `params`): `Promise`<[`Response`](classes/Response.md)<[`FaasData`](#faasdata)<`PathOrData`\>\>\>
286
+ ▸ **faas**\<`PathOrData`\>(`action`, `params`): `Promise`\<[`Response`](classes/Response.md)\<[`FaasData`](#faasdata)\<`PathOrData`\>\>\>
273
287
 
274
288
  Request faas server
275
289
 
@@ -277,18 +291,18 @@ Request faas server
277
291
 
278
292
  | Name | Type |
279
293
  | :------ | :------ |
280
- | `PathOrData` | extends `Record`<`string`, `any`\> |
294
+ | `PathOrData` | extends `Record`\<`string`, `any`\> |
281
295
 
282
296
  #### Parameters
283
297
 
284
298
  | Name | Type | Description |
285
299
  | :------ | :------ | :------ |
286
300
  | `action` | `string` \| `PathOrData` | {string} action name |
287
- | `params` | [`FaasParams`](#faasparams)<`PathOrData`\> | {object} action params |
301
+ | `params` | [`FaasParams`](#faasparams)\<`PathOrData`\> | {object} action params |
288
302
 
289
303
  #### Returns
290
304
 
291
- `Promise`<[`Response`](classes/Response.md)<[`FaasData`](#faasdata)<`PathOrData`\>\>\>
305
+ `Promise`\<[`Response`](classes/Response.md)\<[`FaasData`](#faasdata)\<`PathOrData`\>\>\>
292
306
 
293
307
  ```ts
294
308
  faas<{ title: string }>('post/get', { id: 1 }).then(res => {
@@ -322,9 +336,34 @@ getClient('another-domain')
322
336
 
323
337
  ___
324
338
 
339
+ ### signal
340
+
341
+ ▸ **signal**\<`T`\>(`initialValue`, `options?`): `Signal`\<`T`\>
342
+
343
+ Create a [signal](https://preactjs.com/guide/v10/signals) with options
344
+
345
+ #### Type parameters
346
+
347
+ | Name | Type |
348
+ | :------ | :------ |
349
+ | `T` | `any` |
350
+
351
+ #### Parameters
352
+
353
+ | Name | Type |
354
+ | :------ | :------ |
355
+ | `initialValue` | `any` |
356
+ | `options` | [`SignalOptions`](#signaloptions) |
357
+
358
+ #### Returns
359
+
360
+ `Signal`\<`T`\>
361
+
362
+ ___
363
+
325
364
  ### useFaas
326
365
 
327
- ▸ **useFaas**<`PathOrData`\>(`action`, `defaultParams`, `options?`): [`FaasDataInjection`](#faasdatainjection)<[`FaasData`](#faasdata)<`PathOrData`\>\>
366
+ ▸ **useFaas**\<`PathOrData`\>(`action`, `defaultParams`, `options?`): [`FaasDataInjection`](#faasdatainjection)\<[`FaasData`](#faasdata)\<`PathOrData`\>\>
328
367
 
329
368
  Request faas server with React hook
330
369
 
@@ -332,19 +371,19 @@ Request faas server with React hook
332
371
 
333
372
  | Name | Type |
334
373
  | :------ | :------ |
335
- | `PathOrData` | extends `Record`<`string`, `any`\> |
374
+ | `PathOrData` | extends `Record`\<`string`, `any`\> |
336
375
 
337
376
  #### Parameters
338
377
 
339
378
  | Name | Type | Description |
340
379
  | :------ | :------ | :------ |
341
380
  | `action` | `string` \| `PathOrData` | {string} action name |
342
- | `defaultParams` | [`FaasParams`](#faasparams)<`PathOrData`\> | {object} initial action params |
343
- | `options?` | [`useFaasOptions`](#usefaasoptions)<`PathOrData`\> | - |
381
+ | `defaultParams` | [`FaasParams`](#faasparams)\<`PathOrData`\> | {object} initial action params |
382
+ | `options?` | [`useFaasOptions`](#usefaasoptions)\<`PathOrData`\> | - |
344
383
 
345
384
  #### Returns
346
385
 
347
- [`FaasDataInjection`](#faasdatainjection)<[`FaasData`](#faasdata)<`PathOrData`\>\>
386
+ [`FaasDataInjection`](#faasdatainjection)\<[`FaasData`](#faasdata)\<`PathOrData`\>\>
348
387
 
349
388
  ```ts
350
389
  function Post ({ id }) {
package/dist/index.d.mts CHANGED
@@ -4,6 +4,8 @@ import { Options, ResponseError, Response as Response$1 } from '@faasjs/browser'
4
4
  export { Options, Response, ResponseError, ResponseHeaders } from '@faasjs/browser';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ReactNode, ReactElement, Component } from 'react';
7
+ import * as _preact_signals_core from '@preact/signals-core';
8
+ export { batch, computed, effect, signal as originSignal, useComputed, useSignal, useSignalEffect } from '@preact/signals-react';
7
9
 
8
10
  type FaasReactClientInstance = {
9
11
  id: string
@@ -161,4 +163,25 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, {
161
163
  render(): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode>;
162
164
  }
163
165
 
164
- export { ErrorBoundary, ErrorBoundaryProps, ErrorChildrenProps, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasReactClient, FaasReactClientInstance, faas, getClient, useFaas, useFaasOptions };
166
+ type SignalOptions = {
167
+ debugName?: string;
168
+ };
169
+ /**
170
+ * Create a [signal](https://preactjs.com/guide/v10/signals) with options
171
+ *
172
+ * @param initialValue
173
+ * @param options
174
+ * @param options.debugName - debug name for signal, will print signal value to console.debug
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * import { signal } from '@faasjs/react'
179
+ *
180
+ * const count = signal(0, { debugName: 'count' })
181
+ *
182
+ * count.value = 1
183
+ * ```
184
+ */
185
+ declare function signal<T = any>(initialValue: any, options?: SignalOptions): _preact_signals_core.Signal<T>;
186
+
187
+ export { ErrorBoundary, ErrorBoundaryProps, ErrorChildrenProps, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasReactClient, FaasReactClientInstance, SignalOptions, faas, getClient, signal, useFaas, useFaasOptions };
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ import { Options, ResponseError, Response as Response$1 } from '@faasjs/browser'
4
4
  export { Options, Response, ResponseError, ResponseHeaders } from '@faasjs/browser';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ReactNode, ReactElement, Component } from 'react';
7
+ import * as _preact_signals_core from '@preact/signals-core';
8
+ export { batch, computed, effect, signal as originSignal, useComputed, useSignal, useSignalEffect } from '@preact/signals-react';
7
9
 
8
10
  type FaasReactClientInstance = {
9
11
  id: string
@@ -161,4 +163,25 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, {
161
163
  render(): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode>;
162
164
  }
163
165
 
164
- export { ErrorBoundary, ErrorBoundaryProps, ErrorChildrenProps, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasReactClient, FaasReactClientInstance, faas, getClient, useFaas, useFaasOptions };
166
+ type SignalOptions = {
167
+ debugName?: string;
168
+ };
169
+ /**
170
+ * Create a [signal](https://preactjs.com/guide/v10/signals) with options
171
+ *
172
+ * @param initialValue
173
+ * @param options
174
+ * @param options.debugName - debug name for signal, will print signal value to console.debug
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * import { signal } from '@faasjs/react'
179
+ *
180
+ * const count = signal(0, { debugName: 'count' })
181
+ *
182
+ * count.value = 1
183
+ * ```
184
+ */
185
+ declare function signal<T = any>(initialValue: any, options?: SignalOptions): _preact_signals_core.Signal<T>;
186
+
187
+ export { ErrorBoundary, ErrorBoundaryProps, ErrorChildrenProps, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasReactClient, FaasReactClientInstance, SignalOptions, faas, getClient, signal, useFaas, useFaasOptions };
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var react = require('react');
4
4
  var browser = require('@faasjs/browser');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
+ var signalsReact = require('@preact/signals-react');
6
7
 
7
8
  // src/client.tsx
8
9
  var clients = {};
@@ -224,10 +225,45 @@ var ErrorBoundary = class extends react.Component {
224
225
  return this.props.children;
225
226
  }
226
227
  };
228
+ function signal(initialValue, options = {}) {
229
+ const state = signalsReact.signal(initialValue);
230
+ if (options.debugName)
231
+ signalsReact.effect(() => console.debug(options.debugName, state.value));
232
+ return state;
233
+ }
227
234
 
235
+ Object.defineProperty(exports, 'batch', {
236
+ enumerable: true,
237
+ get: function () { return signalsReact.batch; }
238
+ });
239
+ Object.defineProperty(exports, 'computed', {
240
+ enumerable: true,
241
+ get: function () { return signalsReact.computed; }
242
+ });
243
+ Object.defineProperty(exports, 'effect', {
244
+ enumerable: true,
245
+ get: function () { return signalsReact.effect; }
246
+ });
247
+ Object.defineProperty(exports, 'originSignal', {
248
+ enumerable: true,
249
+ get: function () { return signalsReact.signal; }
250
+ });
251
+ Object.defineProperty(exports, 'useComputed', {
252
+ enumerable: true,
253
+ get: function () { return signalsReact.useComputed; }
254
+ });
255
+ Object.defineProperty(exports, 'useSignal', {
256
+ enumerable: true,
257
+ get: function () { return signalsReact.useSignal; }
258
+ });
259
+ Object.defineProperty(exports, 'useSignalEffect', {
260
+ enumerable: true,
261
+ get: function () { return signalsReact.useSignalEffect; }
262
+ });
228
263
  exports.ErrorBoundary = ErrorBoundary;
229
264
  exports.FaasDataWrapper = FaasDataWrapper;
230
265
  exports.FaasReactClient = FaasReactClient;
231
266
  exports.faas = faas;
232
267
  exports.getClient = getClient;
268
+ exports.signal = signal;
233
269
  exports.useFaas = useFaas;
package/dist/index.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  import { useState, useEffect, cloneElement, Component } from 'react';
2
2
  import { FaasBrowserClient } from '@faasjs/browser';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
+ import { signal as signal$1, effect } from '@preact/signals-react';
5
+ export { batch, computed, effect, signal as originSignal, useComputed, useSignal, useSignalEffect } from '@preact/signals-react';
4
6
 
5
7
  // src/client.tsx
6
8
  var clients = {};
@@ -222,5 +224,11 @@ var ErrorBoundary = class extends Component {
222
224
  return this.props.children;
223
225
  }
224
226
  };
227
+ function signal(initialValue, options = {}) {
228
+ const state = signal$1(initialValue);
229
+ if (options.debugName)
230
+ effect(() => console.debug(options.debugName, state.value));
231
+ return state;
232
+ }
225
233
 
226
- export { ErrorBoundary, FaasDataWrapper, FaasReactClient, faas, getClient, useFaas };
234
+ export { ErrorBoundary, FaasDataWrapper, FaasReactClient, faas, getClient, signal, useFaas };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/react",
3
- "version": "0.0.4-beta.10",
3
+ "version": "0.0.4-beta.12",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,14 +22,17 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@faasjs/browser": "0.0.4-beta.10"
25
+ "@faasjs/browser": "0.0.4-beta.12"
26
26
  },
27
27
  "peerDependencies": {
28
- "react": "*"
28
+ "react": "*",
29
+ "@preact/signals-react": "*"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@types/react": "*",
32
- "react": "*"
33
+ "react": "*",
34
+ "@preact/signals-react": "*",
35
+ "@types/use-sync-external-store": "*"
33
36
  },
34
37
  "engines": {
35
38
  "npm": ">=9.0.0",