mirror of
https://github.com/logos-messaging/waku-react.git
synced 2026-01-03 06:33:07 +00:00
rename to useCreateContentPair
This commit is contained in:
parent
554ef2ace8
commit
8213ee2cb5
@ -1,5 +1,5 @@
|
||||
export { FullNodeOptions, LightNodeOptions, RelayNodeOptions } from "./types";
|
||||
export { useContentPair } from "./useContentPair";
|
||||
export { useCreateContentPair } from "./useCreatContentPair";
|
||||
export {
|
||||
useCreateFullNode,
|
||||
useCreateLightNode,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { RelayCreateOptions, WakuOptions } from "@waku/core";
|
||||
import type { CreateOptions } from "@waku/create";
|
||||
import type { Protocols, Waku } from "@waku/interfaces";
|
||||
import type { Decoder, Encoder } from "@waku/core/dist/lib/message/version_0";
|
||||
|
||||
export type HookState = {
|
||||
isLoading: boolean;
|
||||
@ -23,3 +24,8 @@ export type RelayNodeOptions = CreateOptions &
|
||||
export type FullNodeOptions = CreateOptions &
|
||||
WakuOptions &
|
||||
Partial<RelayCreateOptions>;
|
||||
|
||||
export type ContentPair = {
|
||||
encoder: Encoder;
|
||||
decoder: Decoder;
|
||||
};
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
import React from "react";
|
||||
import { createDecoder, createEncoder } from "@waku/core";
|
||||
import type { Decoder, Encoder } from "@waku/core/dist/lib/message/version_0";
|
||||
|
||||
type ContentPair = {
|
||||
encoder: Encoder;
|
||||
decoder: Decoder;
|
||||
};
|
||||
import type { ContentPair } from "./types";
|
||||
|
||||
/**
|
||||
* Creates Encoder / Decoder pair for a given contentTopic.
|
||||
@ -13,7 +9,7 @@ type ContentPair = {
|
||||
* @param {boolean} ephemeral - makes messages ephemeral, default to false
|
||||
* @returns {Object} Encoder / Decoder pair
|
||||
*/
|
||||
export const useContentPair = (
|
||||
export const useCreateContentPair = (
|
||||
contentTopic: string,
|
||||
ephemeral = false,
|
||||
): ContentPair => {
|
||||
Loading…
x
Reference in New Issue
Block a user