This file contains 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 { pipe } from 'effect/Function' | |
import * as Layer from 'effect/Layer' | |
import * as Tracer from 'effect/Tracer' | |
export const withAsyncTaggingTracing = | |
(makeTrace: (name: string) => { run: (fn: any) => any }) => | |
<A, E, R>(fa: Effect.Effect<A, E, R>) => { | |
const makeTracer = Effect.gen(function* () { |
This file contains 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 Schema from "@effect/schema/Schema" | |
import type * as Serializable from "@effect/schema/Serializable" | |
import type { NonEmptyArray } from "effect/Array" | |
import * as Effect from "effect/Effect" | |
import type * as Exit from "effect/Exit" | |
import { pipe } from "effect/Function" | |
import * as Option from "effect/Option" | |
import * as Ref from "effect/Ref" | |
import type * as Scope from "effect/Scope" |
This file contains 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
const syntaxBigInt = require("@babel/plugin-syntax-bigint").default | |
module.exports = function (babel) { | |
const types = babel.types | |
const visitor = { | |
BigIntLiteral(path) { | |
const value = path.node.value | |
path.replaceWith( | |
types.callExpression(types.identifier("BigInt"), [types.StringLiteral(value)]) |
This file contains 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 D from "effect/Deferred" | |
import * as DU from "effect/Duration" | |
import * as T from "effect/Effect" | |
import * as FID from "effect/FiberId" | |
import { pipe } from "effect/Function" | |
import * as HM from "effect/HashMap" | |
import * as O from "effect/Option" | |
/** | |
* Given a function (key: K) => Effect<R, E, A> this DataLoader |
This file contains 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
module.exports = function (api) { | |
api.cache(true) | |
return { | |
presets: ["babel-preset-expo"], | |
plugins: ["./scripts/babel-plugin-transform-bigint-to-jsbi"] | |
} | |
} |
This file contains 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 DU from "@effect/data/Duration" | |
import { pipe } from "@effect/data/Function" | |
import * as HM from "@effect/data/HashMap" | |
import * as O from "@effect/data/Option" | |
import * as D from "@effect/io/Deferred" | |
import * as T from "@effect/io/Effect" | |
import * as FID from "@effect/io/Fiber/Id" | |
/** | |
* Given a function (key: K) => Effect<R, E, A> this DataLoader |
This file contains 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 ENV from "@effect/data/Context" | |
import { Tag } from "@effect/data/Context" | |
import * as DU from "@effect/data/Duration" | |
import { pipe } from "@effect/data/Function" | |
import * as O from "@effect/data/Option" | |
import * as D from "@effect/io/Deferred" | |
import * as T from "@effect/io/Effect" | |
import type * as EX from "@effect/io/Exit" | |
import * as FID from "@effect/io/Fiber/Id" | |
import * as HUB from "@effect/io/Hub" |
This file contains 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 Effect from "@effect/io/Effect"; | |
import * as Chunk from "@effect/data/Chunk"; | |
import * as Deferred from "@effect/io/Deferred"; | |
import * as Option from "@effect/data/Option"; | |
import { pipe } from "@effect/data/Function"; | |
interface Request<E, A> extends Effect.Effect<never, E, A> {} | |
interface RequestEntry<A extends Request<any, any>> { | |
request: A; |
This file contains 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 { Show } from "@fp-ts/codec/Show" | |
import * as C from "@fp-ts/data/Context" | |
interface Meta<P> { | |
meta: P | |
} | |
interface MetaSchema<C> extends Meta<unknown> { | |
_tag: unknown | |
_C?: C |
This file contains 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/core/io/Effect" | |
import * as SE from "@effect/core/stm/TSemaphore" | |
import * as HM from "@tsplus/stdlib/collections/HashMap" | |
import { pipe } from "@tsplus/stdlib/data/Function" | |
import * as O from "@tsplus/stdlib/data/Maybe" | |
/** | |
* Given a function (key: K) => Effect<R, E, A> this DataLoader | |
* batches and caches requests such as concurrent lookups | |
* for the same key cannot happen. |
NewerOlder