small-state-react 0.1.2 → 0.1.3

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.cjs CHANGED
@@ -21,7 +21,9 @@ function useRuntime(machine, options) {
21
21
  }, [runtime, qOptions]);
22
22
  return {
23
23
  snapshot,
24
- send: runtime.send.bind(runtime),
24
+ send: (event) => {
25
+ runtime.send.apply(runtime, [event]);
26
+ },
25
27
  runtime
26
28
  };
27
29
  }
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { AnyMachine, Runtime, RuntimeOptions, Snapshot } from "small-state";
1
+ import { AnyMachine, Runtime, RuntimeOptions, SendFnEvent, Snapshot } from "small-state";
2
2
  export declare function useRuntime<M extends AnyMachine>(machine: M, options?: RuntimeOptions<M> & {
3
3
  onPreStart?: (runtime: Runtime<M>) => void;
4
4
  }): {
5
5
  snapshot: import("small-state").Snapshot<M>;
6
- send: (event: import("small-state").SendFnEvent<M>) => Runtime<M>;
6
+ send: (event: SendFnEvent<M>) => undefined;
7
7
  runtime: Runtime<M>;
8
8
  };
9
9
  export declare function useSelectedSnapshot<M extends AnyMachine, Sel>(runtime: Runtime<M> | undefined, selector: (snapshot: Snapshot<M>) => Sel, compare?: (current: Sel, next: Sel) => boolean): Sel;
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { AnyMachine, Runtime, RuntimeOptions, Snapshot } from "small-state";
1
+ import { AnyMachine, Runtime, RuntimeOptions, SendFnEvent, Snapshot } from "small-state";
2
2
  export declare function useRuntime<M extends AnyMachine>(machine: M, options?: RuntimeOptions<M> & {
3
3
  onPreStart?: (runtime: Runtime<M>) => void;
4
4
  }): {
5
5
  snapshot: import("small-state").Snapshot<M>;
6
- send: (event: import("small-state").SendFnEvent<M>) => Runtime<M>;
6
+ send: (event: SendFnEvent<M>) => undefined;
7
7
  runtime: Runtime<M>;
8
8
  };
9
9
  export declare function useSelectedSnapshot<M extends AnyMachine, Sel>(runtime: Runtime<M> | undefined, selector: (snapshot: Snapshot<M>) => Sel, compare?: (current: Sel, next: Sel) => boolean): Sel;
package/dist/index.mjs CHANGED
@@ -20,7 +20,9 @@ function useRuntime(machine, options) {
20
20
  }, [runtime, qOptions]);
21
21
  return {
22
22
  snapshot,
23
- send: runtime.send.bind(runtime),
23
+ send: (event) => {
24
+ runtime.send.apply(runtime, [event]);
25
+ },
24
26
  runtime
25
27
  };
26
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "small-state-react",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "React and Jotai bindings for small-state, a lightweight state machine library.",
5
5
  "author": "qyvvy",
6
6
  "license": "MIT",