Skip to content

Commit

Permalink
refactor: extract config context to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed Nov 24, 2024
1 parent a41f3f1 commit bd7b063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/contexts/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { Config } from "@reactive-dot/core";
import { createContext } from "react";

export const ConfigContext = createContext<Config | undefined>(undefined);
13 changes: 3 additions & 10 deletions packages/react/src/contexts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { useWalletsInitializer } from "../hooks/use-wallets-initializer.js";
import { ConfigContext } from "./config.js";
import { MutationEventSubjectContext } from "./mutation.js";
import type { Config } from "@reactive-dot/core";
import {
createContext,
Suspense,
useEffect,
useMemo,
type PropsWithChildren,
} from "react";
import { Suspense, useEffect, useMemo, type PropsWithChildren } from "react";
import { Subject } from "rxjs";

export {
Expand All @@ -17,13 +12,11 @@ export {
} from "./chain.js";

export {
SignerProvider,
SignerContext,
SignerProvider,
type SignerProviderProps,
} from "./signer.js";

export const ConfigContext = createContext<Config | undefined>(undefined);

export type ReactiveDotProviderProps = PropsWithChildren<{
/**
* Global config used by ReactiveDOT.
Expand Down

0 comments on commit bd7b063

Please sign in to comment.