mirror of
https://github.com/logos-messaging/waku-react.git
synced 2026-01-03 22:53:06 +00:00
chore: upgrade waku sdk
This commit is contained in:
parent
602a02cf9e
commit
4dde5e4ea1
1455
package-lock.json
generated
1455
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@waku/react",
|
"name": "@waku/react",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"description": "React hooks and components to use js-waku",
|
"description": "React hooks and components to use js-waku",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.cjs.js",
|
"main": "dist/index.cjs.js",
|
||||||
@ -87,8 +87,8 @@
|
|||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@waku/interfaces": "^0.0.26-ce62600.0",
|
"@waku/interfaces": "^0.0.27",
|
||||||
"@waku/sdk": "^0.0.27-ce62600.0",
|
"@waku/sdk": "^0.0.28",
|
||||||
"react": "^16.8.0 || ^17 || ^18"
|
"react": "^16.8.0 || ^17 || ^18"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
|
|||||||
@ -58,7 +58,12 @@ export const useFilterMessages = (
|
|||||||
let unsubscribe: null | Unsubscribe = null;
|
let unsubscribe: null | Unsubscribe = null;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
(node.filter.subscribe([decoder], pushMessage) as Promise<Unsubscribe>)
|
(
|
||||||
|
node.filter.subscribeWithUnsubscribe(
|
||||||
|
[decoder],
|
||||||
|
pushMessage,
|
||||||
|
) as Promise<Unsubscribe>
|
||||||
|
)
|
||||||
.then((unsubscribeFn) => {
|
.then((unsubscribeFn) => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
unsubscribe = unsubscribeFn;
|
unsubscribe = unsubscribeFn;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import type {
|
|||||||
IDecodedMessage,
|
IDecodedMessage,
|
||||||
IDecoder,
|
IDecoder,
|
||||||
IStoreSDK,
|
IStoreSDK,
|
||||||
StoreQueryOptions,
|
QueryRequestParams,
|
||||||
Waku,
|
Waku,
|
||||||
} from "@waku/interfaces";
|
} from "@waku/interfaces";
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ type AbstractStoreNode = Waku & {
|
|||||||
type UseStoreMessagesParams = {
|
type UseStoreMessagesParams = {
|
||||||
node: undefined | AbstractStoreNode;
|
node: undefined | AbstractStoreNode;
|
||||||
decoder: undefined | IDecoder<IDecodedMessage>;
|
decoder: undefined | IDecoder<IDecodedMessage>;
|
||||||
options: StoreQueryOptions;
|
options: QueryRequestParams;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UseStoreMessagesResult = HookState & {
|
type UseStoreMessagesResult = HookState & {
|
||||||
@ -29,7 +29,7 @@ type UseStoreMessagesResult = HookState & {
|
|||||||
* const { isLoading, error, messages } = useStoreMessages({node, decoder, options});
|
* const { isLoading, error, messages } = useStoreMessages({node, decoder, options});
|
||||||
* @param {Object} node - node that implement Store, hook does nothing if undefined
|
* @param {Object} node - node that implement Store, hook does nothing if undefined
|
||||||
* @param {Object} decoder - decoder to use for getting messages, hook does nothing if undefined
|
* @param {Object} decoder - decoder to use for getting messages, hook does nothing if undefined
|
||||||
* @param {StoreQueryOptions} options - options to initiate query to get messages
|
* @param {QueryRequestParams} options - options to initiate query to get messages
|
||||||
* @returns {Object} hook state (isLoading, error) and messages array
|
* @returns {Object} hook state (isLoading, error) and messages array
|
||||||
*/
|
*/
|
||||||
export const useStoreMessages = (
|
export const useStoreMessages = (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user