@loona/core
Version:
App State Management done with GraphQL (core package)
21 lines (20 loc) • 777 B
TypeScript
import { DocumentNode } from 'graphql';
import { MutationOptions } from 'apollo-client';
import { FetchResult } from 'apollo-link';
import { Context } from './common';
import { MutationObject } from './mutation';
export declare type EffectMethod = (action: Action | MutationAsAction, context: EffectContext) => void;
export interface ActionObject {
type: string;
}
export declare type Action = ActionObject | MutationAsAction;
export interface MutationAsAction extends FetchResult<any> {
type: string;
options: MutationOptions;
ok: boolean;
error?: any;
}
export declare type EffectDef = string | DocumentNode | ActionObject | MutationObject;
export interface EffectContext extends Context {
dispatch: (action: ActionObject | MutationObject) => void;
}