mirror of
https://github.com/logos-messaging/waku-react.git
synced 2026-04-10 05:43:42 +00:00
remove full node hook, provider
This commit is contained in:
parent
c32769a859
commit
f200133b70
@ -99,33 +99,3 @@ export const RelayNodeProvider: React.FunctionComponent<
|
|||||||
<WakuContext.Provider value={result}>{props.children}</WakuContext.Provider>
|
<WakuContext.Provider value={result}>{props.children}</WakuContext.Provider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Provider for creating Full Node based on options passed.
|
|
||||||
* @example
|
|
||||||
* const App = (props) => (
|
|
||||||
* <FullNodeProvider options={{...}}>
|
|
||||||
* <Component />
|
|
||||||
* </FullNodeProvider>
|
|
||||||
* );
|
|
||||||
* const Component = (props) => {
|
|
||||||
* const { node, isLoading, error } = useWaku<FullNode>();
|
|
||||||
* ...
|
|
||||||
* };
|
|
||||||
* @param {Object} props - options to create a node and other React props
|
|
||||||
* @param {FullNodeOptions} props.options - optional options for creating Full Node
|
|
||||||
* @param {Protocols} props.protocols - optional protocols list to initiate node with
|
|
||||||
* @returns React Full Node provider component
|
|
||||||
*/
|
|
||||||
export const FullNodeProvider: React.FunctionComponent<
|
|
||||||
ProviderProps<FullNodeOptions>
|
|
||||||
> = (props) => {
|
|
||||||
const result = useCreateFullNode({
|
|
||||||
options: props.options,
|
|
||||||
protocols: props.protocols,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<WakuContext.Provider value={result}>{props.children}</WakuContext.Provider>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|||||||
@ -87,17 +87,3 @@ export const useCreateRelayNode = (
|
|||||||
factory: createRelayNode,
|
factory: createRelayNode,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Full Node helper hook.
|
|
||||||
* @param {Object} params - optional params to configure & bootstrap node
|
|
||||||
* @returns {CrateWakuHook} node, loading state and error
|
|
||||||
*/
|
|
||||||
export const useCreateFullNode = (
|
|
||||||
params?: BootstrapNodeOptions<FullNodeOptions>,
|
|
||||||
) => {
|
|
||||||
return useCreateNode<FullNode, FullNodeOptions>({
|
|
||||||
...params,
|
|
||||||
factory: createFullNode,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user