applesauce-react 0.0.0-next-20251220152312 → 0.0.0-next-20251231055351

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.
@@ -1,6 +1,6 @@
1
1
  export * from "./use-account-manager.js";
2
2
  export * from "./use-accounts.js";
3
- export * from "./use-action-hub.js";
3
+ export * from "./use-action-runner.js";
4
4
  export * from "./use-action.js";
5
5
  export * from "./use-active-account.js";
6
6
  export * from "./use-event-factory.js";
@@ -1,6 +1,6 @@
1
1
  export * from "./use-account-manager.js";
2
2
  export * from "./use-accounts.js";
3
- export * from "./use-action-hub.js";
3
+ export * from "./use-action-runner.js";
4
4
  export * from "./use-action.js";
5
5
  export * from "./use-active-account.js";
6
6
  export * from "./use-event-factory.js";
@@ -0,0 +1 @@
1
+ export declare function useActionRunner(): import("applesauce-actions").ActionRunner;
@@ -1,6 +1,6 @@
1
1
  import { useContext } from "react";
2
2
  import { ActionsContext } from "../providers/actions-provider.js";
3
- export function useActionHub() {
3
+ export function useActionRunner() {
4
4
  const hub = useContext(ActionsContext);
5
5
  if (!hub)
6
6
  throw new Error("Missing ActionsProvider");
@@ -1,11 +1,11 @@
1
1
  import { useCallback, useRef, useState } from "react";
2
2
  import { finalize } from "rxjs";
3
- import { useActionHub } from "./use-action-hub.js";
3
+ import { useActionRunner } from "./use-action-runner.js";
4
4
  export function useAction(Action, args) {
5
5
  const [loading, setLoading] = useState(false);
6
6
  const ref = useRef(args);
7
7
  ref.current = args;
8
- const hub = useActionHub();
8
+ const hub = useActionRunner();
9
9
  const run = useCallback(async () => {
10
10
  if (args === undefined)
11
11
  return;
@@ -1,7 +1,7 @@
1
1
  import { PropsWithChildren } from "react";
2
- import { ActionHub } from "applesauce-actions";
3
- export declare const ActionsContext: import("react").Context<ActionHub | undefined>;
4
- /** Provides an ActionHub to the component tree */
5
- export declare function ActionsProvider({ actionHub, children }: PropsWithChildren<{
6
- actionHub?: ActionHub;
2
+ import { ActionRunner } from "applesauce-actions";
3
+ export declare const ActionsContext: import("react").Context<ActionRunner | undefined>;
4
+ /** Provides an ActionRunner to the component tree */
5
+ export declare function ActionsProvider({ runner, children }: PropsWithChildren<{
6
+ runner?: ActionRunner;
7
7
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext } from "react";
3
3
  export const ActionsContext = createContext(undefined);
4
- /** Provides an ActionHub to the component tree */
5
- export function ActionsProvider({ actionHub, children }) {
6
- return _jsx(ActionsContext.Provider, { value: actionHub, children: children });
4
+ /** Provides an ActionRunner to the component tree */
5
+ export function ActionsProvider({ runner, children }) {
6
+ return _jsx(ActionsContext.Provider, { value: runner, children: children });
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-react",
3
- "version": "0.0.0-next-20251220152312",
3
+ "version": "0.0.0-next-20251231055351",
4
4
  "description": "React hooks for applesauce",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -48,10 +48,10 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "applesauce-accounts": "0.0.0-next-20251220152312",
52
- "applesauce-actions": "0.0.0-next-20251220152312",
53
- "applesauce-content": "0.0.0-next-20251220152312",
54
- "applesauce-core": "0.0.0-next-20251220152312",
51
+ "applesauce-accounts": "0.0.0-next-20251231055351",
52
+ "applesauce-actions": "0.0.0-next-20251231055351",
53
+ "applesauce-content": "0.0.0-next-20251231055351",
54
+ "applesauce-core": "0.0.0-next-20251231055351",
55
55
  "hash-sum": "^2.0.0",
56
56
  "observable-hooks": "^4.2.4",
57
57
  "react": "^18.3.1",
@@ -1 +0,0 @@
1
- export declare function useActionHub(): import("applesauce-actions").ActionHub;