This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Http from "@effect/platform/HttpClient" | |
import { Context, Effect, Layer, pipe } from "effect" | |
const headers = { | |
Accept: | |
"application/graphql-response+json; charset=utf-8, application/json; charset=utf-8", | |
"Content-Type": "application/json", | |
} | |
export class GraphQLClient extends Context.Tag("graphql-codegen/GraphQLClient")< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Duration, Scope } from "effect" | |
import { Effect, SynchronizedRef } from "effect" | |
export const make = (limit: number, window: Duration.DurationInput): Effect.Effect< | |
<A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>, | |
never, | |
Scope.Scope | |
> => | |
Effect.gen(function*(_) { | |
const scope = yield* _(Effect.scope) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Schema, TreeFormatter } from "@effect/schema" | |
import { | |
Cause, | |
Context, | |
Data, | |
Effect, | |
Either, | |
Layer, | |
Option, | |
PrimaryKey, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Context from "effect/Context" | |
import * as Effect from "effect/Effect" | |
import * as Exit from "effect/Exit" | |
import * as Layer from "effect/Layer" | |
import * as Runtime from "effect/Runtime" | |
import * as Scope from "effect/Scope" | |
export interface RuntimeClass<R> extends AsyncDisposable { | |
readonly close: () => Promise<void> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Chunk, | |
Deferred, | |
Duration, | |
Effect, | |
Queue, | |
Ref, | |
Request, | |
RequestResolver, | |
} from "effect" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { httpApp, response, router } from "@effect-http/core" | |
import { decodeParams } from "@effect-http/core/schema" | |
import { serve } from "@effect-http/node" | |
import { pipe } from "@effect/data/Function" | |
import * as Effect from "@effect/io/Effect" | |
import * as Schema from "@effect/schema/Schema" | |
import * as Http from "http" | |
const app = pipe( | |
router |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
pnpm-lock.yaml | |
*.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const make = Effect.struct({ | |
ref: SubscriptionRef.make(0), | |
}); | |
export interface Counter extends Effect.Success<typeof make> {} | |
export const Counter = Tag<Counter>(); | |
export const CounterLive = Layer.fromEffect(Counter)(make); | |
export const increment = Effect.serviceWithEffect(Counter, ({ ref }) => | |
ref.update((count) => count + 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as T from "@effect-ts/core/Effect" | |
import * as S from "@effect-ts/core/Effect/Experimental/Stream" | |
import * as L from "@effect-ts/core/Effect/Layer" | |
import * as M from "@effect-ts/core/Effect/Managed" | |
import * as Q from "@effect-ts/core/Effect/Queue" | |
import * as SC from "@effect-ts/core/Effect/Schedule" | |
import { literal, pipe } from "@effect-ts/core/Function" | |
import { tag } from "@effect-ts/core/Has" | |
import * as O from "@effect-ts/core/Option" | |
import type { _A } from "@effect-ts/core/Utils" |