New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@airma/react-effect

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airma/react-effect - npm Package Compare versions

Comparing version

to
17.1.3

68

index.d.ts

@@ -55,6 +55,16 @@ import { Keys, Key } from '@airma/react-state';

> & {
effect: [E];
effect: [E, { sessionType?: SessionType }];
implement: (c: E) => void;
};
declare interface QuerySessionKey<E extends PromiseCallback<any>>
extends SessionKey<E> {
effect: [E, { sessionType?: 'query' }];
}
declare interface MutationSessionKey<E extends PromiseCallback<any>>
extends SessionKey<E> {
effect: [E, { sessionType?: 'mutation' }];
}
declare type StrategyCollectionType<T> =

@@ -114,7 +124,9 @@ | undefined

config: DefaultQueryConfig<PCR<D>, MCC<D>>
): [
LoadedSessionState<PCR<D>>,
() => Promise<LoadedSessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<LoadedSessionState<PCR<D>>>
];
): D extends MutationSessionKey<any>
? never
: [
LoadedSessionState<PCR<D>>,
() => Promise<LoadedSessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<LoadedSessionState<PCR<D>>>
];
export declare function useQuery<

@@ -125,7 +137,9 @@ D extends PromiseCallback<any> | SessionKey<any>

config?: QueryConfig<PCR<D>, MCC<D>> | Parameters<MCC<D>>
): [
SessionState<PCR<D>>,
() => Promise<SessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<SessionState<PCR<D>>>
];
): D extends MutationSessionKey<any>
? never
: [
SessionState<PCR<D>>,
() => Promise<SessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<SessionState<PCR<D>>>
];

@@ -137,7 +151,9 @@ export declare function useMutation<

config: DefaultMutationConfig<PCR<D>, MCC<D>>
): [
LoadedSessionState<PCR<D>>,
() => Promise<LoadedSessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<LoadedSessionState<PCR<D>>>
];
): D extends QuerySessionKey<any>
? never
: [
LoadedSessionState<PCR<D>>,
() => Promise<LoadedSessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<LoadedSessionState<PCR<D>>>
];
export declare function useMutation<

@@ -148,7 +164,9 @@ D extends PromiseCallback<any> | SessionKey<any>

config?: MutationConfig<PCR<D>, MCC<D>> | Parameters<MCC<D>>
): [
SessionState<PCR<D>>,
() => Promise<SessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<SessionState<PCR<D>>>
];
): D extends QuerySessionKey<any>
? never
: [
SessionState<PCR<D>>,
() => Promise<SessionState<PCR<D>>>,
(...variables: Parameters<MCC<D>>) => Promise<SessionState<PCR<D>>>
];

@@ -186,3 +204,9 @@ declare interface UseSessionConfig {

E extends (...params: any[]) => Promise<any>
>(effectCallback: E, sessionType?: SessionType): SessionKey<E>;
>(effectCallback: E): SessionKey<E>;
export declare function createSessionKey<
E extends (...params: any[]) => Promise<any>
>(effectCallback: E, sessionType: 'query'): QuerySessionKey<E>;
export declare function createSessionKey<
E extends (...params: any[]) => Promise<any>
>(effectCallback: E, sessionType: 'mutation'): MutationSessionKey<E>;

@@ -189,0 +213,0 @@ export declare function useIsFetching(

{
"private": false,
"name": "@airma/react-effect",
"version": "17.1.2",
"version": "17.1.3",
"description": "This is a react async state management tool",

@@ -6,0 +6,0 @@ "license": "MIT",