Skip to content

add GetAvengerClient util #44

Description

@fes300

should have the following API:

import { Eq } from 'fp-ts/lib/Eq';
import { CacheValue } from 'avenger/lib/CacheValue.ts'
import { StrategyBuilder } from 'avenger/lib/Query.ts'

type TSCompose<..> = ....
type TSproduct<...> = ....

type TSQuery<E, A, L, P> = {
  type: "Query";
  IOCheck: Eq<CacheValue<E, A>>;
  FetchStrategy: StrategyBuilder<A, L, P>;
  endpoint: EndpointInstance<...> | TSCompose<..> | TSproduct<...>,
}

type TSCommand<E, A, L, P> = {
  type: "Command";
  endpoint: EndpointInstance<...>,
  invalidates: Record<string, TSQuery<any, any, any, any>>
}

type TSEndpoint<...> = TSQuery<...> | TSCommand<...>

declare function GetAvengerClient<K extends string>(e: Record<K, TSEndpoint>): {
  commands: Record<string, (a: A, ia?: ProductA<I>) => TaskEither<L | IL, P>> ;
  queries: CachedQuery<A, L, P>
}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions