Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add GetAvengerClient util #44

Open
fes300 opened this issue Oct 23, 2020 · 0 comments
Open

add GetAvengerClient util #44

fes300 opened this issue Oct 23, 2020 · 0 comments
Assignees
Labels
feature new feature

Comments

@fes300
Copy link
Owner

fes300 commented Oct 23, 2020

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>
}
@fes300 fes300 created this issue from a note in ts-endpoint-avenger (To do) Oct 23, 2020
@fes300 fes300 self-assigned this Oct 23, 2020
@fes300 fes300 added the feature new feature label Oct 23, 2020
@fes300 fes300 moved this from To do to In progress in ts-endpoint-avenger Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature
Projects
No open projects
Development

No branches or pull requests

1 participant