@effect-app/vue 2.67.0 → 2.67.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -779,247 +779,249 @@ export class Commander extends Effect.Service<Commander>()("Commander", {
779
779
 
780
780
  const makeCommand = <RT>(runtime: Runtime.Runtime<RT>) => {
781
781
  const runFork = Runtime.runFork(runtime)
782
- return <const Id extends string>(id: Id, errorDef?: Error) =>
783
- <Args extends ReadonlyArray<unknown>, A, E, R extends RT | CommandContext>(
784
- handler: (...args: Args) => Effect.Effect<A, E, R>
785
- ) => {
786
- // we capture the definition stack here, so we can append it to later stack traces
787
- const limit = Error.stackTraceLimit
788
- Error.stackTraceLimit = 2
789
- const localErrorDef = new Error()
790
- Error.stackTraceLimit = limit
791
- if (!errorDef) {
792
- errorDef = localErrorDef
793
- }
794
-
782
+ return <const Id extends string>(id: Id, errorDef?: Error) => {
795
783
  const context = makeContext(id)
796
- const action = context.action
797
-
798
- const errorReporter = <A, E, R>(self: Effect.Effect<A, E, R>) =>
799
- self.pipe(
800
- Effect.tapErrorCause(
801
- Effect.fnUntraced(function*(cause) {
802
- if (Cause.isInterruptedOnly(cause)) {
803
- console.info(`Interrupted while trying to ${id}`)
804
- return
805
- }
806
784
 
807
- const fail = Cause.failureOption(cause)
808
- if (Option.isSome(fail)) {
809
- // if (fail.value._tag === "SuppressErrors") {
810
- // console.info(
811
- // `Suppressed error trying to ${action}`,
812
- // fail.value,
813
- // )
814
- // return
815
- // }
816
- const message = `Failure trying to ${id}`
817
- yield* reportMessage(message, {
818
- action: id,
819
- error: fail.value
820
- })
821
- return
822
- }
785
+ return Object.assign(<Args extends ReadonlyArray<unknown>, A, E, R extends RT | CommandContext>(
786
+ handler: (...args: Args) => Effect.Effect<A, E, R>
787
+ ) => {
788
+ // we capture the definition stack here, so we can append it to later stack traces
789
+ const limit = Error.stackTraceLimit
790
+ Error.stackTraceLimit = 2
791
+ const localErrorDef = new Error()
792
+ Error.stackTraceLimit = limit
793
+ if (!errorDef) {
794
+ errorDef = localErrorDef
795
+ }
823
796
 
824
- const extra = {
825
- action,
826
- message: `Unexpected Error trying to ${id}`
827
- }
828
- yield* reportRuntimeError(cause, extra)
829
- }, Effect.uninterruptible)
797
+ const action = context.action
798
+
799
+ const errorReporter = <A, E, R>(self: Effect.Effect<A, E, R>) =>
800
+ self.pipe(
801
+ Effect.tapErrorCause(
802
+ Effect.fnUntraced(function*(cause) {
803
+ if (Cause.isInterruptedOnly(cause)) {
804
+ console.info(`Interrupted while trying to ${id}`)
805
+ return
806
+ }
807
+
808
+ const fail = Cause.failureOption(cause)
809
+ if (Option.isSome(fail)) {
810
+ // if (fail.value._tag === "SuppressErrors") {
811
+ // console.info(
812
+ // `Suppressed error trying to ${action}`,
813
+ // fail.value,
814
+ // )
815
+ // return
816
+ // }
817
+ const message = `Failure trying to ${id}`
818
+ yield* reportMessage(message, {
819
+ action: id,
820
+ error: fail.value
821
+ })
822
+ return
823
+ }
824
+
825
+ const extra = {
826
+ action,
827
+ message: `Unexpected Error trying to ${id}`
828
+ }
829
+ yield* reportRuntimeError(cause, extra)
830
+ }, Effect.uninterruptible)
831
+ )
830
832
  )
833
+
834
+ const theHandler = flow(
835
+ handler,
836
+ // all must be within the Effect.fn to fit within the Span
837
+ Effect.provideService(CommandContext, context),
838
+ (_) => Effect.annotateCurrentSpan({ action }).pipe(Effect.zipRight(_)),
839
+ errorReporter
831
840
  )
832
841
 
833
- const theHandler = flow(
834
- handler,
835
- // all must be within the Effect.fn to fit within the Span
836
- Effect.provideService(CommandContext, context),
837
- (_) => Effect.annotateCurrentSpan({ action }).pipe(Effect.zipRight(_)),
838
- errorReporter
839
- )
842
+ const [result, exec] = asResult(theHandler)
840
843
 
841
- const [result, exec] = asResult(theHandler)
844
+ const waiting = computed(() => result.value.waiting)
842
845
 
843
- const waiting = computed(() => result.value.waiting)
846
+ const handle = Object.assign((...args: Args) => {
847
+ // we capture the call site stack here
848
+ const limit = Error.stackTraceLimit
849
+ Error.stackTraceLimit = 2
850
+ const errorCall = new Error()
851
+ Error.stackTraceLimit = limit
844
852
 
845
- const handle = Object.assign((...args: Args) => {
846
- // we capture the call site stack here
847
- const limit = Error.stackTraceLimit
848
- Error.stackTraceLimit = 2
849
- const errorCall = new Error()
850
- Error.stackTraceLimit = limit
851
-
852
- let cache: false | string = false
853
- const captureStackTrace = () => {
854
- // in case of an error, we want to append the definition stack to the call site stack,
855
- // so we can see where the handler was defined too
853
+ let cache: false | string = false
854
+ const captureStackTrace = () => {
855
+ // in case of an error, we want to append the definition stack to the call site stack,
856
+ // so we can see where the handler was defined too
856
857
 
857
- if (cache !== false) {
858
- return cache
859
- }
860
- if (errorCall.stack) {
861
- const stackDef = errorDef!.stack!.trim().split("\n")
862
- const stackCall = errorCall.stack.trim().split("\n")
863
- let endStackDef = stackDef.slice(2).join("\n").trim()
864
- if (!endStackDef.includes(`(`)) {
865
- endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
858
+ if (cache !== false) {
859
+ return cache
866
860
  }
867
- let endStackCall = stackCall.slice(2).join("\n").trim()
868
- if (!endStackCall.includes(`(`)) {
869
- endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
861
+ if (errorCall.stack) {
862
+ const stackDef = errorDef!.stack!.trim().split("\n")
863
+ const stackCall = errorCall.stack.trim().split("\n")
864
+ let endStackDef = stackDef.slice(2).join("\n").trim()
865
+ if (!endStackDef.includes(`(`)) {
866
+ endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
867
+ }
868
+ let endStackCall = stackCall.slice(2).join("\n").trim()
869
+ if (!endStackCall.includes(`(`)) {
870
+ endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
871
+ }
872
+ cache = `${endStackDef}\n${endStackCall}`
873
+ return cache
870
874
  }
871
- cache = `${endStackDef}\n${endStackCall}`
872
- return cache
873
875
  }
874
- }
875
876
 
876
- const command = Effect.withSpan(
877
- exec(...args),
878
- id,
879
- { captureStackTrace }
880
- )
877
+ const command = Effect.withSpan(
878
+ exec(...args),
879
+ id,
880
+ { captureStackTrace }
881
+ )
881
882
 
882
- return runFork(command)
883
- }, { action })
883
+ return runFork(command)
884
+ }, { action })
884
885
 
885
- const handleEffect = Object.assign((...args: Args) => {
886
- // we capture the call site stack here
887
- const limit = Error.stackTraceLimit
888
- Error.stackTraceLimit = 2
889
- const errorCall = new Error()
890
- Error.stackTraceLimit = limit
886
+ const handleEffect = Object.assign((...args: Args) => {
887
+ // we capture the call site stack here
888
+ const limit = Error.stackTraceLimit
889
+ Error.stackTraceLimit = 2
890
+ const errorCall = new Error()
891
+ Error.stackTraceLimit = limit
891
892
 
892
- let cache: false | string = false
893
- const captureStackTrace = () => {
894
- // in case of an error, we want to append the definition stack to the call site stack,
895
- // so we can see where the handler was defined too
893
+ let cache: false | string = false
894
+ const captureStackTrace = () => {
895
+ // in case of an error, we want to append the definition stack to the call site stack,
896
+ // so we can see where the handler was defined too
896
897
 
897
- if (cache !== false) {
898
- return cache
899
- }
900
- if (errorCall.stack) {
901
- const stackDef = errorDef!.stack!.trim().split("\n")
902
- const stackCall = errorCall.stack.trim().split("\n")
903
- let endStackDef = stackDef.slice(2).join("\n").trim()
904
- if (!endStackDef.includes(`(`)) {
905
- endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
898
+ if (cache !== false) {
899
+ return cache
906
900
  }
907
- let endStackCall = stackCall.slice(2).join("\n").trim()
908
- if (!endStackCall.includes(`(`)) {
909
- endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
901
+ if (errorCall.stack) {
902
+ const stackDef = errorDef!.stack!.trim().split("\n")
903
+ const stackCall = errorCall.stack.trim().split("\n")
904
+ let endStackDef = stackDef.slice(2).join("\n").trim()
905
+ if (!endStackDef.includes(`(`)) {
906
+ endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
907
+ }
908
+ let endStackCall = stackCall.slice(2).join("\n").trim()
909
+ if (!endStackCall.includes(`(`)) {
910
+ endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
911
+ }
912
+ cache = `${endStackDef}\n${endStackCall}`
913
+ return cache
910
914
  }
911
- cache = `${endStackDef}\n${endStackCall}`
912
- return cache
913
915
  }
914
- }
915
916
 
916
- const command = Effect.withSpan(
917
- exec(...args),
918
- id,
919
- { captureStackTrace }
920
- )
917
+ const command = Effect.withSpan(
918
+ exec(...args),
919
+ id,
920
+ { captureStackTrace }
921
+ )
921
922
 
922
- return Effect.currentSpan.pipe(
923
- Effect.option,
924
- Effect.map((span) =>
925
- runFork(Option.isSome(span) ? command.pipe(Effect.withParentSpan(span.value)) : command)
923
+ return Effect.currentSpan.pipe(
924
+ Effect.option,
925
+ Effect.map((span) =>
926
+ runFork(Option.isSome(span) ? command.pipe(Effect.withParentSpan(span.value)) : command)
927
+ )
926
928
  )
927
- )
928
- }, { action })
929
+ }, { action })
929
930
 
930
- const compose = Object.assign((...args: Args) => {
931
- // we capture the call site stack here
932
- const limit = Error.stackTraceLimit
933
- Error.stackTraceLimit = 2
934
- const errorCall = new Error()
935
- Error.stackTraceLimit = limit
931
+ const compose = Object.assign((...args: Args) => {
932
+ // we capture the call site stack here
933
+ const limit = Error.stackTraceLimit
934
+ Error.stackTraceLimit = 2
935
+ const errorCall = new Error()
936
+ Error.stackTraceLimit = limit
936
937
 
937
- let cache: false | string = false
938
- const captureStackTrace = () => {
939
- // in case of an error, we want to append the definition stack to the call site stack,
940
- // so we can see where the handler was defined too
938
+ let cache: false | string = false
939
+ const captureStackTrace = () => {
940
+ // in case of an error, we want to append the definition stack to the call site stack,
941
+ // so we can see where the handler was defined too
941
942
 
942
- if (cache !== false) {
943
- return cache
944
- }
945
- if (errorCall.stack) {
946
- const stackDef = errorDef!.stack!.trim().split("\n")
947
- const stackCall = errorCall.stack.trim().split("\n")
948
- let endStackDef = stackDef.slice(2).join("\n").trim()
949
- if (!endStackDef.includes(`(`)) {
950
- endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
943
+ if (cache !== false) {
944
+ return cache
951
945
  }
952
- let endStackCall = stackCall.slice(2).join("\n").trim()
953
- if (!endStackCall.includes(`(`)) {
954
- endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
946
+ if (errorCall.stack) {
947
+ const stackDef = errorDef!.stack!.trim().split("\n")
948
+ const stackCall = errorCall.stack.trim().split("\n")
949
+ let endStackDef = stackDef.slice(2).join("\n").trim()
950
+ if (!endStackDef.includes(`(`)) {
951
+ endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
952
+ }
953
+ let endStackCall = stackCall.slice(2).join("\n").trim()
954
+ if (!endStackCall.includes(`(`)) {
955
+ endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
956
+ }
957
+ cache = `${endStackDef}\n${endStackCall}`
958
+ return cache
955
959
  }
956
- cache = `${endStackDef}\n${endStackCall}`
957
- return cache
958
960
  }
959
- }
960
961
 
961
- const command = Effect.withSpan(
962
- exec(...args),
963
- id,
964
- { captureStackTrace }
965
- )
962
+ const command = Effect.withSpan(
963
+ exec(...args),
964
+ id,
965
+ { captureStackTrace }
966
+ )
966
967
 
967
- return command
968
- }, { action })
968
+ return command
969
+ }, { action })
969
970
 
970
- const compose2 = Object.assign((...args: Args) => {
971
- // we capture the call site stack here
972
- const limit = Error.stackTraceLimit
973
- Error.stackTraceLimit = 2
974
- const errorCall = new Error()
975
- Error.stackTraceLimit = limit
971
+ const compose2 = Object.assign((...args: Args) => {
972
+ // we capture the call site stack here
973
+ const limit = Error.stackTraceLimit
974
+ Error.stackTraceLimit = 2
975
+ const errorCall = new Error()
976
+ Error.stackTraceLimit = limit
976
977
 
977
- let cache: false | string = false
978
- const captureStackTrace = () => {
979
- // in case of an error, we want to append the definition stack to the call site stack,
980
- // so we can see where the handler was defined too
978
+ let cache: false | string = false
979
+ const captureStackTrace = () => {
980
+ // in case of an error, we want to append the definition stack to the call site stack,
981
+ // so we can see where the handler was defined too
981
982
 
982
- if (cache !== false) {
983
- return cache
984
- }
985
- if (errorCall.stack) {
986
- const stackDef = errorDef!.stack!.trim().split("\n")
987
- const stackCall = errorCall.stack.trim().split("\n")
988
- let endStackDef = stackDef.slice(2).join("\n").trim()
989
- if (!endStackDef.includes(`(`)) {
990
- endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
983
+ if (cache !== false) {
984
+ return cache
991
985
  }
992
- let endStackCall = stackCall.slice(2).join("\n").trim()
993
- if (!endStackCall.includes(`(`)) {
994
- endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
986
+ if (errorCall.stack) {
987
+ const stackDef = errorDef!.stack!.trim().split("\n")
988
+ const stackCall = errorCall.stack.trim().split("\n")
989
+ let endStackDef = stackDef.slice(2).join("\n").trim()
990
+ if (!endStackDef.includes(`(`)) {
991
+ endStackDef = endStackDef.replace(/at (.*)/, "at ($1)")
992
+ }
993
+ let endStackCall = stackCall.slice(2).join("\n").trim()
994
+ if (!endStackCall.includes(`(`)) {
995
+ endStackCall = endStackCall.replace(/at (.*)/, "at ($1)")
996
+ }
997
+ cache = `${endStackDef}\n${endStackCall}`
998
+ return cache
995
999
  }
996
- cache = `${endStackDef}\n${endStackCall}`
997
- return cache
998
1000
  }
999
- }
1000
1001
 
1001
- const command = Effect.withSpan(
1002
- exec(...args).pipe(Effect.flatten),
1003
- id,
1004
- { captureStackTrace }
1005
- )
1002
+ const command = Effect.withSpan(
1003
+ exec(...args).pipe(Effect.flatten),
1004
+ id,
1005
+ { captureStackTrace }
1006
+ )
1006
1007
 
1007
- return command
1008
- }, { action })
1009
-
1010
- return reactive({
1011
- id,
1012
- namespaced: context.namespaced,
1013
- namespace: context.namespace,
1014
- result,
1015
- waiting,
1016
- action,
1017
- handle,
1018
- handleEffect,
1019
- compose,
1020
- compose2,
1021
- exec
1022
- })
1008
+ return command
1009
+ }, { action })
1010
+
1011
+ return reactive({
1012
+ id,
1013
+ namespaced: context.namespaced,
1014
+ namespace: context.namespace,
1015
+ result,
1016
+ waiting,
1017
+ action,
1018
+ handle,
1019
+ handleEffect,
1020
+ compose,
1021
+ compose2,
1022
+ exec
1023
+ })
1024
+ }, context)
1023
1025
  }
1024
1026
  }
1025
1027
 
@@ -1236,26 +1238,26 @@ export class Commander extends Effect.Service<Commander>()("Commander", {
1236
1238
  fn: <RT>(runtime: Runtime.Runtime<RT>) => {
1237
1239
  const make = makeCommand(runtime)
1238
1240
  return <const Id extends string>(id: Id): Commander.Gen<RT, Id> & Commander.NonGen<RT, Id> =>
1239
- (
1240
- fn: any,
1241
- ...combinators: any[]
1242
- ): any => {
1243
- // we capture the definition stack here, so we can append it to later stack traces
1244
- const limit = Error.stackTraceLimit
1245
- Error.stackTraceLimit = 2
1246
- const errorDef = new Error()
1247
- Error.stackTraceLimit = limit
1241
+ Object.assign((
1242
+ fn: any,
1243
+ ...combinators: any[]
1244
+ ): any => {
1245
+ // we capture the definition stack here, so we can append it to later stack traces
1246
+ const limit = Error.stackTraceLimit
1247
+ Error.stackTraceLimit = 2
1248
+ const errorDef = new Error()
1249
+ Error.stackTraceLimit = limit
1248
1250
 
1249
- return make(id, errorDef)(
1250
- Effect.fnUntraced(
1251
- // fnUntraced only supports generators as first arg, so we convert to generator if needed
1252
- isGeneratorFunction(fn) ? fn : function*(...args) {
1253
- return yield* fn(...args)
1254
- },
1255
- ...combinators as [any]
1256
- ) as any
1257
- )
1258
- }
1251
+ return make(id, errorDef)(
1252
+ Effect.fnUntraced(
1253
+ // fnUntraced only supports generators as first arg, so we convert to generator if needed
1254
+ isGeneratorFunction(fn) ? fn : function*(...args) {
1255
+ return yield* fn(...args)
1256
+ },
1257
+ ...combinators as [any]
1258
+ ) as any
1259
+ )
1260
+ }, makeContext(id))
1259
1261
  },
1260
1262
 
1261
1263
  alt2: ((rt: any) => {
@@ -1266,7 +1268,7 @@ export class Commander extends Effect.Service<Commander>()("Commander", {
1266
1268
  const context = makeContext(id)
1267
1269
  const idCmd = cmd(id)
1268
1270
  // TODO: implement proper tracing stack
1269
- return (cb: any) =>
1271
+ return Object.assign((cb: any) =>
1270
1272
  idCmd(cb(
1271
1273
  Object.assign(
1272
1274
  (fn: any, ...combinators: any[]) =>
@@ -1282,7 +1284,7 @@ export class Commander extends Effect.Service<Commander>()("Commander", {
1282
1284
  ? { mutate: "mutate" in _id ? _id.mutate : typeof _id === "function" ? _id : undefined }
1283
1285
  : {}
1284
1286
  )
1285
- ))
1287
+ )), context)
1286
1288
  }
1287
1289
  }) as unknown as <RT>(
1288
1290
  runtime: Runtime.Runtime<RT>
@@ -1291,21 +1293,25 @@ export class Commander extends Effect.Service<Commander>()("Commander", {
1291
1293
  | Id
1292
1294
  | { id: Id; mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR> }
1293
1295
  | ((...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>) & { id: Id }
1294
- ) => <Args extends Array<unknown>, A, E, R extends RT | CommandContext>(
1295
- handler: (
1296
- ctx: Effect.fn.Gen & Effect.fn.NonGen & Commander.CommandContextLocal<Id> & {
1297
- // todo: only if we passed in one
1298
- mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>
1299
- }
1300
- ) => (...args: Args) => Effect.Effect<A, E, R>
1301
- ) => Commander.CommandOut<Args, A, E, R, Id>,
1296
+ ) =>
1297
+ & Commander.CommandContextLocal<Id>
1298
+ & (<Args extends Array<unknown>, A, E, R extends RT | CommandContext>(
1299
+ handler: (
1300
+ ctx: Effect.fn.Gen & Effect.fn.NonGen & Commander.CommandContextLocal<Id> & {
1301
+ // todo: only if we passed in one
1302
+ mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>
1303
+ }
1304
+ ) => (...args: Args) => Effect.Effect<A, E, R>
1305
+ ) => Commander.CommandOut<Args, A, E, R, Id>),
1302
1306
 
1303
1307
  /** @experimental */
1304
1308
  alt: makeCommand as unknown as <RT>(runtime: Runtime.Runtime<RT>) => <const Id extends string>(
1305
1309
  id: Id
1306
- ) => <Args extends Array<unknown>, A, E, R extends RT | CommandContext>(
1307
- handler: (...args: Args) => Effect.Effect<A, E, R>
1308
- ) => Commander.CommandOut<Args, A, E, R, Id>,
1310
+ ) =>
1311
+ & Commander.CommandContextLocal<Id>
1312
+ & (<Args extends Array<unknown>, A, E, R extends RT | CommandContext>(
1313
+ handler: (...args: Args) => Effect.Effect<A, E, R>
1314
+ ) => Commander.CommandOut<Args, A, E, R, Id>),
1309
1315
 
1310
1316
  /** @experimental */
1311
1317
  wrap: <RT>(runtime: Runtime.Runtime<RT>) => {
@@ -1314,28 +1320,31 @@ export class Commander extends Effect.Service<Commander>()("Commander", {
1314
1320
  mutation:
1315
1321
  | { mutate: (...args: Args) => Effect.Effect<A, E, R>; id: Id }
1316
1322
  | ((...args: Args) => Effect.Effect<A, E, R>) & { id: Id }
1317
- ): Commander.GenWrap<RT, Id, Args, A, E, R> & Commander.NonGenWrap<RT, Id, Args, A, E, R> =>
1318
- (
1319
- ...combinators: any[]
1320
- ): any => {
1321
- // we capture the definition stack here, so we can append it to later stack traces
1322
- const limit = Error.stackTraceLimit
1323
- Error.stackTraceLimit = 2
1324
- const errorDef = new Error()
1325
- Error.stackTraceLimit = limit
1323
+ ):
1324
+ & Commander.CommandContextLocal<Id>
1325
+ & Commander.GenWrap<RT, Id, Args, A, E, R>
1326
+ & Commander.NonGenWrap<RT, Id, Args, A, E, R> =>
1327
+ Object.assign((
1328
+ ...combinators: any[]
1329
+ ): any => {
1330
+ // we capture the definition stack here, so we can append it to later stack traces
1331
+ const limit = Error.stackTraceLimit
1332
+ Error.stackTraceLimit = 2
1333
+ const errorDef = new Error()
1334
+ Error.stackTraceLimit = limit
1326
1335
 
1327
- const mutate = "mutate" in mutation ? mutation.mutate : mutation
1336
+ const mutate = "mutate" in mutation ? mutation.mutate : mutation
1328
1337
 
1329
- return make(mutation.id, errorDef)(
1330
- Effect.fnUntraced(
1331
- // fnUntraced only supports generators as first arg, so we convert to generator if needed
1332
- isGeneratorFunction(mutate) ? mutate : function*(...args: Args) {
1333
- return yield* mutate(...args)
1334
- },
1335
- ...combinators as [any]
1336
- ) as any
1337
- )
1338
- }
1338
+ return make(mutation.id, errorDef)(
1339
+ Effect.fnUntraced(
1340
+ // fnUntraced only supports generators as first arg, so we convert to generator if needed
1341
+ isGeneratorFunction(mutate) ? mutate : function*(...args: Args) {
1342
+ return yield* mutate(...args)
1343
+ },
1344
+ ...combinators as [any]
1345
+ ) as any
1346
+ )
1347
+ }, makeContext(mutation.id))
1339
1348
  }
1340
1349
  }
1341
1350
  })