@xstate/react 3.1.2 → 3.2.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.
@@ -36,4 +36,4 @@ s((function(t,e){}));var S=s((function(t){t.exports=y}));
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
38
  */
39
- s((function(t,e){}));var k=s((function(t){t.exports=w})),C=e.useLayoutEffect;function P(t){var e=a.useRef();return e.current||(e.current={v:t()}),e.current.v}function R(t,e){var r=P((function(){return"function"==typeof t?t():t})),u=e.context,o=e.guards,a=e.actions,c=e.activities,s=e.services,f=e.delays;e.state;var l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(r=Object.getOwnPropertySymbols(t);u<r.length;u++)e.indexOf(r[u])<0&&Object.prototype.propertyIsEnumerable.call(t,r[u])&&(n[r[u]]=t[r[u]])}return n}(e,["context","guards","actions","activities","services","delays","state"]),v=P((function(){var t={context:u,guards:o,actions:a,activities:c,services:s,delays:f},e=r.withConfig(t,(function(){return i(i({},r.context),u)}));return n.interpret(e,l)}));return C((function(){Object.assign(v.machine.options.actions,a),Object.assign(v.machine.options.guards,o),Object.assign(v.machine.options.activities,c),Object.assign(v.machine.options.services,s),Object.assign(v.machine.options.delays,f)}),[a,o,c,s,f]),v}function N(t){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];var o=c(r,2),a=o[0],i=void 0===a?{}:a,s=o[1],f=R(t,i);return e.useEffect((function(){if(s){var t=f.subscribe(n.toObserver(s));return function(){t.unsubscribe()}}}),[s]),e.useEffect((function(){var t=i.state;return f.start(t?n.State.create(t):void 0),function(){f.stop(),f.status=n.InterpreterStatus.NotStarted}}),[]),f}function I(t){return 0!==t.status?t.getSnapshot():t.machine.initialState}function A(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function V(t){return"state"in t&&"machine"in t}function M(t,e,r){if(t.status===n.InterpreterStatus.NotStarted)return!0;var u=void 0===r.changed&&(Object.keys(r.children).length>0||"boolean"==typeof e.changed);return!(r.changed||u)}function W(t){return t}function _(t){return t}function q(t){return"state"in t}function D(t){return"deferred"in t}function L(t){return"getSnapshot"in t?V(t)?I(t):t.getSnapshot():q(t)?t.state:void 0}function T(t,n){void 0===n&&(n=L);var r=e.useRef(t),u=e.useRef([]),o=e.useCallback((function(e){return t.subscribe(e).unsubscribe}),[t]),a=e.useCallback((function(){return n(t)}),[t,n]),i=e.useCallback((function(e,n){return V(t)?M(t,e,n):e===n}),[t]),c=k.useSyncExternalStoreWithSelector(o,a,a,_,i),s=P((function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],o=r.current;D(o)&&o.deferred?u.current.push(n):o.send(n)}}));return C((function(){for(r.current=t;u.current.length>0;){var e=u.current.shift();t.send(e)}}),[t]),[c,s]}var X=function(t,e){return t===e};function z(t,n,r,u){void 0===r&&(r=X);var o=e.useRef(null),a=e.useCallback((function(e){return t.subscribe(e).unsubscribe}),[t]),i=e.useCallback((function(){return u?u(t):function(t,e){if(V(t)){if(0===t.status&&e.current)return e.current;var n=I(t);return e.current=0===t.status?n:null,n}return q(t)?t.state:void 0}(t,o)}),[t,u]);return k.useSyncExternalStoreWithSelector(a,i,i,n,r)}t.createActorContext=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=c(e,2),u=r[0],o=void 0===u?{}:u,i=r[1],s=a.createContext(null),f=s.Provider;function l(e){var n=e.children,r=e.machine,u=N(void 0===r?t:r,o,i);return a.createElement(f,{value:u},n)}function v(){var t=a.useContext(s);if(!t)throw new Error('You used a hook from "'.concat(l.displayName,"\" but it's not inside a <").concat(l.displayName,"> component."));return t}function d(){return T(v())}function p(t,e){return z(v(),t,e)}return l.displayName="ActorProvider(".concat(t.id,")"),{Provider:l,useActorRef:v,useActor:d,useSelector:p}},t.shallowEqual=function(t,e){if(A(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var u=0;u<n.length;u++)if(!Object.prototype.hasOwnProperty.call(e,n[u])||!A(t[n[u]],e[n[u]]))return!1;return!0},t.useActor=T,t.useInterpret=N,t.useMachine=function(t){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];var o=c(r,1),a=o[0],i=void 0===a?{}:a,s=R(t,i),f=e.useCallback((function(){return s.status===n.InterpreterStatus.NotStarted?i.state?n.State.create(i.state):s.machine.initialState:s.getSnapshot()}),[s]),l=e.useCallback((function(t,e){return M(s,t,e)}),[s]),v=e.useCallback((function(t){return s.subscribe(t).unsubscribe}),[s]),d=k.useSyncExternalStoreWithSelector(v,f,f,W,l);return e.useEffect((function(){var t=i.state;return s.start(t?n.State.create(t):void 0),function(){s.stop(),s.status=n.InterpreterStatus.NotStarted}}),[]),[d,s.send,s]},t.useSelector=z,t.useSpawn=function(t){return P((function(){return n.spawnBehavior(t)}))},Object.defineProperty(t,"__esModule",{value:!0})}));
39
+ s((function(t,e){}));var k=s((function(t){t.exports=w})),C=e.useLayoutEffect;function P(t){var e=a.useRef();return e.current||(e.current={v:t()}),e.current.v}function R(t,e){var r=P((function(){return"function"==typeof t?t():t})),u=e.context,o=e.guards,a=e.actions,c=e.activities,s=e.services,f=e.delays;e.state;var l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(r=Object.getOwnPropertySymbols(t);u<r.length;u++)e.indexOf(r[u])<0&&Object.prototype.propertyIsEnumerable.call(t,r[u])&&(n[r[u]]=t[r[u]])}return n}(e,["context","guards","actions","activities","services","delays","state"]),v=P((function(){var t={context:u,guards:o,actions:a,activities:c,services:s,delays:f},e=r.withConfig(t,(function(){return i(i({},r.context),u)}));return n.interpret(e,l)}));return C((function(){Object.assign(v.machine.options.actions,a),Object.assign(v.machine.options.guards,o),Object.assign(v.machine.options.activities,c),Object.assign(v.machine.options.services,s),Object.assign(v.machine.options.delays,f)}),[a,o,c,s,f]),v}function N(t){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];var o=c(r,2),a=o[0],i=void 0===a?{}:a,s=o[1],f=R(t,i);return e.useEffect((function(){if(s){var t=f.subscribe(n.toObserver(s));return function(){t.unsubscribe()}}}),[s]),e.useEffect((function(){var t=i.state;return f.start(t?n.State.create(t):void 0),function(){f.stop(),f.status=n.InterpreterStatus.NotStarted}}),[]),f}function I(t){return 0!==t.status?t.getSnapshot():t.machine.initialState}function A(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function V(t){return"state"in t&&"machine"in t}function M(t,e,r){if(t.status===n.InterpreterStatus.NotStarted)return!0;var u=void 0===r.changed&&(Object.keys(r.children).length>0||"boolean"==typeof e.changed);return!(r.changed||u)}function W(t){return t}function _(t){return t}function q(t){return"state"in t}function D(t){return"deferred"in t}function L(t){return"getSnapshot"in t?V(t)?I(t):t.getSnapshot():q(t)?t.state:void 0}function T(t,n){void 0===n&&(n=L);var r=e.useRef(t),u=e.useRef([]),o=e.useCallback((function(e){return t.subscribe(e).unsubscribe}),[t]),a=e.useCallback((function(){return n(t)}),[t,n]),i=e.useCallback((function(e,n){return V(t)?M(t,e,n):e===n}),[t]),c=k.useSyncExternalStoreWithSelector(o,a,a,_,i),s=P((function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],o=r.current;D(o)&&o.deferred?u.current.push(n):o.send(n)}}));return C((function(){for(r.current=t;u.current.length>0;){var e=u.current.shift();t.send(e)}}),[t]),[c,s]}var X=function(t,e){return t===e};function z(t,n,r,u){void 0===r&&(r=X);var o=e.useRef(null),a=e.useCallback((function(e){return t.subscribe(e).unsubscribe}),[t]),i=e.useCallback((function(){return u?u(t):function(t,e){if(V(t)){if(0===t.status&&e.current)return e.current;var n=I(t);return e.current=0===t.status?n:null,n}return q(t)?t.state:void 0}(t,o)}),[t,u]);return k.useSyncExternalStoreWithSelector(a,i,i,n,r)}t.createActorContext=function(t,e,n){var r=a.createContext(null),u=r.Provider;function o(r){var o=r.children,c=r.machine,s=void 0===c?t:c,f=r.options,l=N(s,i(i({},e),f),n);return a.createElement(u,{value:l},o)}function c(){var t=a.useContext(r);if(!t)throw new Error('You used a hook from "'.concat(o.displayName,"\" but it's not inside a <").concat(o.displayName,"> component."));return t}return o.displayName="ActorProvider(".concat(t.id,")"),{Provider:o,useActorRef:c,useActor:function(){return T(c())},useSelector:function(t,e){return z(c(),t,e)}}},t.shallowEqual=function(t,e){if(A(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var u=0;u<n.length;u++)if(!Object.prototype.hasOwnProperty.call(e,n[u])||!A(t[n[u]],e[n[u]]))return!1;return!0},t.useActor=T,t.useInterpret=N,t.useMachine=function(t){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];var o=c(r,1),a=o[0],i=void 0===a?{}:a,s=R(t,i),f=e.useCallback((function(){return s.status===n.InterpreterStatus.NotStarted?i.state?n.State.create(i.state):s.machine.initialState:s.getSnapshot()}),[s]),l=e.useCallback((function(t,e){return M(s,t,e)}),[s]),v=e.useCallback((function(t){return s.subscribe(t).unsubscribe}),[s]),d=k.useSyncExternalStoreWithSelector(v,f,f,W,l);return e.useEffect((function(){var t=i.state;return s.start(t?n.State.create(t):void 0),function(){s.stop(),s.status=n.InterpreterStatus.NotStarted}}),[]),[d,s.send,s]},t.useSelector=z,t.useSpawn=function(t){return P((function(){return n.spawnBehavior(t)}))},Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -1,14 +1,17 @@
1
1
  import * as React from 'react';
2
- import { RestParams } from './useInterpret';
3
- import { useActor as useActorUnbound } from './useActor';
4
- import { ActorRefFrom, AnyStateMachine, EmittedFrom } from 'xstate';
5
- export declare function createActorContext<TMachine extends AnyStateMachine>(machine: TMachine, ...[options, observerOrListener]: RestParams<TMachine>): {
6
- useActor: () => ReturnType<typeof useActorUnbound<ActorRefFrom<TMachine>>>;
2
+ import { ActorRefFrom, AnyStateMachine, AreAllImplementationsAssumedToBeProvided, EmittedFrom, InternalMachineOptions, InterpreterOptions, Observer, StateFrom } from 'xstate';
3
+ import { UseMachineOptions } from './useMachine';
4
+ export declare function createActorContext<TMachine extends AnyStateMachine>(machine: TMachine, interpreterOptions?: InterpreterOptions, observerOrListener?: Observer<StateFrom<TMachine>> | ((value: StateFrom<TMachine>) => void)): {
5
+ useActor: () => [StateFrom<TMachine>, ActorRefFrom<TMachine>['send']];
7
6
  useSelector: <T>(selector: (snapshot: EmittedFrom<TMachine>) => T, compare?: (a: T, b: T) => boolean) => T;
8
7
  useActorRef: () => ActorRefFrom<TMachine>;
9
8
  Provider: (props: {
10
9
  children: React.ReactNode;
11
10
  machine?: TMachine | (() => TMachine);
12
- }) => React.ReactElement<any, any>;
11
+ } & (AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends false ? {
12
+ options: UseMachineOptions<TMachine['__TContext'], TMachine['__TEvent']> & InternalMachineOptions<TMachine['__TContext'], TMachine['__TEvent'], TMachine['__TResolvedTypesMeta'], true>;
13
+ } : {
14
+ options?: UseMachineOptions<TMachine['__TContext'], TMachine['__TEvent']> & InternalMachineOptions<TMachine['__TContext'], TMachine['__TEvent'], TMachine['__TResolvedTypesMeta']>;
15
+ })) => React.ReactElement<any, any>;
13
16
  };
14
17
  //# sourceMappingURL=createActorContext.d.ts.map
@@ -1,34 +1,24 @@
1
- var __read = (this && this.__read) || function (o, n) {
2
- var m = typeof Symbol === "function" && o[Symbol.iterator];
3
- if (!m) return o;
4
- var i = m.call(o), r, ar = [], e;
5
- try {
6
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
- }
8
- catch (error) { e = { error: error }; }
9
- finally {
10
- try {
11
- if (r && !r.done && (m = i["return"])) m.call(i);
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
12
7
  }
13
- finally { if (e) throw e.error; }
14
- }
15
- return ar;
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
16
11
  };
17
12
  import * as React from 'react';
18
13
  import { useInterpret } from './useInterpret';
19
14
  import { useActor as useActorUnbound } from './useActor';
20
15
  import { useSelector as useSelectorUnbound } from './useSelector';
21
- export function createActorContext(machine) {
22
- var _a = [];
23
- for (var _i = 1; _i < arguments.length; _i++) {
24
- _a[_i - 1] = arguments[_i];
25
- }
26
- var _b = __read(_a, 2), _c = _b[0], options = _c === void 0 ? {} : _c, observerOrListener = _b[1];
16
+ export function createActorContext(machine, interpreterOptions, observerOrListener) {
27
17
  var ReactContext = React.createContext(null);
28
18
  var OriginalProvider = ReactContext.Provider;
29
19
  function Provider(_a) {
30
- var children = _a.children, _b = _a.machine, providedMachine = _b === void 0 ? machine : _b;
31
- var actor = useInterpret(providedMachine, options, observerOrListener);
20
+ var children = _a.children, _b = _a.machine, providedMachine = _b === void 0 ? machine : _b, options = _a.options;
21
+ var actor = useInterpret(providedMachine, __assign(__assign({}, interpreterOptions), options), observerOrListener);
32
22
  return React.createElement(OriginalProvider, { value: actor }, children);
33
23
  }
34
24
  Provider.displayName = "ActorProvider(".concat(machine.id, ")");
@@ -2,7 +2,7 @@ import { AnyInterpreter, AnyStateMachine, AreAllImplementationsAssumedToBeProvid
2
2
  import { MaybeLazy } from './types';
3
3
  import { UseMachineOptions } from './useMachine';
4
4
  export declare function useIdleInterpreter(getMachine: MaybeLazy<AnyStateMachine>, options: Partial<InterpreterOptions> & Partial<UseMachineOptions<unknown, never>> & Partial<MachineOptions<unknown, never>>): AnyInterpreter;
5
- export declare type RestParams<TMachine extends AnyStateMachine> = AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends false ? [
5
+ declare type RestParams<TMachine extends AnyStateMachine> = AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends false ? [
6
6
  options: InterpreterOptions & UseMachineOptions<TMachine['__TContext'], TMachine['__TEvent']> & InternalMachineOptions<TMachine['__TContext'], TMachine['__TEvent'], TMachine['__TResolvedTypesMeta'], true>,
7
7
  observerOrListener?: Observer<StateFrom<TMachine>> | ((value: StateFrom<TMachine>) => void)
8
8
  ] : [
@@ -10,4 +10,5 @@ export declare type RestParams<TMachine extends AnyStateMachine> = AreAllImpleme
10
10
  observerOrListener?: Observer<StateFrom<TMachine>> | ((value: StateFrom<TMachine>) => void)
11
11
  ];
12
12
  export declare function useInterpret<TMachine extends AnyStateMachine>(getMachine: MaybeLazy<TMachine>, ...[options, observerOrListener]: RestParams<TMachine>): InterpreterFrom<TMachine>;
13
+ export {};
13
14
  //# sourceMappingURL=useInterpret.d.ts.map
@@ -1,14 +1,17 @@
1
1
  import * as React from 'react';
2
- import { RestParams } from './useInterpret';
3
- import { useActor as useActorUnbound } from './useActor';
4
- import { ActorRefFrom, AnyStateMachine, EmittedFrom } from 'xstate';
5
- export declare function createActorContext<TMachine extends AnyStateMachine>(machine: TMachine, ...[options, observerOrListener]: RestParams<TMachine>): {
6
- useActor: () => ReturnType<typeof useActorUnbound<ActorRefFrom<TMachine>>>;
2
+ import { ActorRefFrom, AnyStateMachine, AreAllImplementationsAssumedToBeProvided, EmittedFrom, InternalMachineOptions, InterpreterOptions, Observer, StateFrom } from 'xstate';
3
+ import { UseMachineOptions } from './useMachine';
4
+ export declare function createActorContext<TMachine extends AnyStateMachine>(machine: TMachine, interpreterOptions?: InterpreterOptions, observerOrListener?: Observer<StateFrom<TMachine>> | ((value: StateFrom<TMachine>) => void)): {
5
+ useActor: () => [StateFrom<TMachine>, ActorRefFrom<TMachine>['send']];
7
6
  useSelector: <T>(selector: (snapshot: EmittedFrom<TMachine>) => T, compare?: (a: T, b: T) => boolean) => T;
8
7
  useActorRef: () => ActorRefFrom<TMachine>;
9
8
  Provider: (props: {
10
9
  children: React.ReactNode;
11
10
  machine?: TMachine | (() => TMachine);
12
- }) => React.ReactElement<any, any>;
11
+ } & (AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends false ? {
12
+ options: UseMachineOptions<TMachine['__TContext'], TMachine['__TEvent']> & InternalMachineOptions<TMachine['__TContext'], TMachine['__TEvent'], TMachine['__TResolvedTypesMeta'], true>;
13
+ } : {
14
+ options?: UseMachineOptions<TMachine['__TContext'], TMachine['__TEvent']> & InternalMachineOptions<TMachine['__TContext'], TMachine['__TEvent'], TMachine['__TResolvedTypesMeta']>;
15
+ })) => React.ReactElement<any, any>;
13
16
  };
14
17
  //# sourceMappingURL=createActorContext.d.ts.map
@@ -1,19 +1,14 @@
1
1
  "use strict";
2
- var __read = (this && this.__read) || function (o, n) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4
- if (!m) return o;
5
- var i = m.call(o), r, ar = [], e;
6
- try {
7
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
- }
9
- catch (error) { e = { error: error }; }
10
- finally {
11
- try {
12
- if (r && !r.done && (m = i["return"])) m.call(i);
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
13
8
  }
14
- finally { if (e) throw e.error; }
15
- }
16
- return ar;
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
17
12
  };
18
13
  Object.defineProperty(exports, "__esModule", { value: true });
19
14
  exports.createActorContext = void 0;
@@ -21,17 +16,12 @@ var React = require("react");
21
16
  var useInterpret_1 = require("./useInterpret");
22
17
  var useActor_1 = require("./useActor");
23
18
  var useSelector_1 = require("./useSelector");
24
- function createActorContext(machine) {
25
- var _a = [];
26
- for (var _i = 1; _i < arguments.length; _i++) {
27
- _a[_i - 1] = arguments[_i];
28
- }
29
- var _b = __read(_a, 2), _c = _b[0], options = _c === void 0 ? {} : _c, observerOrListener = _b[1];
19
+ function createActorContext(machine, interpreterOptions, observerOrListener) {
30
20
  var ReactContext = React.createContext(null);
31
21
  var OriginalProvider = ReactContext.Provider;
32
22
  function Provider(_a) {
33
- var children = _a.children, _b = _a.machine, providedMachine = _b === void 0 ? machine : _b;
34
- var actor = (0, useInterpret_1.useInterpret)(providedMachine, options, observerOrListener);
23
+ var children = _a.children, _b = _a.machine, providedMachine = _b === void 0 ? machine : _b, options = _a.options;
24
+ var actor = (0, useInterpret_1.useInterpret)(providedMachine, __assign(__assign({}, interpreterOptions), options), observerOrListener);
35
25
  return React.createElement(OriginalProvider, { value: actor }, children);
36
26
  }
37
27
  Provider.displayName = "ActorProvider(".concat(machine.id, ")");
@@ -2,7 +2,7 @@ import { AnyInterpreter, AnyStateMachine, AreAllImplementationsAssumedToBeProvid
2
2
  import { MaybeLazy } from './types';
3
3
  import { UseMachineOptions } from './useMachine';
4
4
  export declare function useIdleInterpreter(getMachine: MaybeLazy<AnyStateMachine>, options: Partial<InterpreterOptions> & Partial<UseMachineOptions<unknown, never>> & Partial<MachineOptions<unknown, never>>): AnyInterpreter;
5
- export declare type RestParams<TMachine extends AnyStateMachine> = AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends false ? [
5
+ declare type RestParams<TMachine extends AnyStateMachine> = AreAllImplementationsAssumedToBeProvided<TMachine['__TResolvedTypesMeta']> extends false ? [
6
6
  options: InterpreterOptions & UseMachineOptions<TMachine['__TContext'], TMachine['__TEvent']> & InternalMachineOptions<TMachine['__TContext'], TMachine['__TEvent'], TMachine['__TResolvedTypesMeta'], true>,
7
7
  observerOrListener?: Observer<StateFrom<TMachine>> | ((value: StateFrom<TMachine>) => void)
8
8
  ] : [
@@ -10,4 +10,5 @@ export declare type RestParams<TMachine extends AnyStateMachine> = AreAllImpleme
10
10
  observerOrListener?: Observer<StateFrom<TMachine>> | ((value: StateFrom<TMachine>) => void)
11
11
  ];
12
12
  export declare function useInterpret<TMachine extends AnyStateMachine>(getMachine: MaybeLazy<TMachine>, ...[options, observerOrListener]: RestParams<TMachine>): InterpreterFrom<TMachine>;
13
+ export {};
13
14
  //# sourceMappingURL=useInterpret.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xstate/react",
3
- "version": "3.1.2",
3
+ "version": "3.2.1",
4
4
  "description": "XState tools for React",
5
5
  "keywords": [
6
6
  "state",
@@ -54,7 +54,7 @@
54
54
  "peerDependencies": {
55
55
  "@xstate/fsm": "^2.0.0",
56
56
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
57
- "xstate": "^4.35.4"
57
+ "xstate": "^4.36.0"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@xstate/fsm": {