@@ -7,7 +7,7 @@ import type * as Subscribable from "./Subscribable.js"
|
||||
export const MutationTypeId: unique symbol = Symbol.for("@effect-fc/Mutation/Mutation")
|
||||
export type MutationTypeId = typeof MutationTypeId
|
||||
|
||||
export interface Mutation<in out K extends Mutation.AnyKey, in out A, in out E = never, in out R = never>
|
||||
export interface Mutation<in out K, in out A, in out E = never, in out R = never>
|
||||
extends Pipeable.Pipeable {
|
||||
readonly [MutationTypeId]: MutationTypeId
|
||||
|
||||
@@ -23,11 +23,10 @@ extends Pipeable.Pipeable {
|
||||
mutateSubscribable(key: K): Effect.Effect<Subscribable.Subscribable<AsyncResult.AsyncResult<A, E>>>
|
||||
}
|
||||
|
||||
export declare namespace Mutation {
|
||||
export type AnyKey = readonly any[]
|
||||
}
|
||||
export const isMutation = (u: unknown): u is Mutation<unknown, unknown, unknown, unknown> => Predicate.hasProperty(u, MutationTypeId)
|
||||
|
||||
export class MutationImpl<in out K extends Mutation.AnyKey, in out A, in out E = never, in out R = never>
|
||||
|
||||
export class MutationImpl<in out K, in out A, in out E = never, in out R = never>
|
||||
extends Pipeable.Class implements Mutation<K, A, E, R> {
|
||||
readonly [MutationTypeId]: MutationTypeId = MutationTypeId
|
||||
|
||||
@@ -129,16 +128,13 @@ extends Pipeable.Class implements Mutation<K, A, E, R> {
|
||||
}
|
||||
|
||||
|
||||
export const isMutation = (u: unknown): u is Mutation<readonly unknown[], unknown, unknown, unknown> => Predicate.hasProperty(u, MutationTypeId)
|
||||
|
||||
|
||||
export declare namespace make {
|
||||
export interface Options<K extends Mutation.AnyKey = never, A = void, E = never, R = never> {
|
||||
export interface Options<K = never, A = void, E = never, R = never> {
|
||||
readonly f: (key: K) => Effect.Effect<A, E, R>
|
||||
}
|
||||
}
|
||||
|
||||
export const make = Effect.fnUntraced(function* <const K extends Mutation.AnyKey = never, A = void, E = never, R = never>(
|
||||
export const make = Effect.fnUntraced(function* <K = never, A = void, E = never, R = never>(
|
||||
options: make.Options<K, A, E, R>
|
||||
): Effect.fn.Return<
|
||||
Mutation<K, A, E, R>,
|
||||
|
||||
Reference in New Issue
Block a user