Skip to content

Commit

Permalink
chore: Update versions
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Nov 27, 2024
1 parent 648fa92 commit 0677419
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
6 changes: 6 additions & 0 deletions packages/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @effect-app/vue

## 2.12.0

### Minor Changes

- fix: input-less action is just an effect.

## 2.11.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@effect-app/vue",
"version": "2.11.0",
"version": "2.12.0",
"license": "MIT",
"type": "module",
"homepage": "https://github.com/effect-ts-app/libs/tree/main/packages/vue",
Expand Down
21 changes: 15 additions & 6 deletions packages/vue/src/makeClient2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Resp<I, A, E, R> = readonly [

type ActResp<A, E, R> = readonly [
ComputedRef<Res<A, E>>,
WithAction<() => Effect<Exit<A, E>, never, R>>
WithAction<Effect<Exit<A, E>, never, R>>
]

export const makeClient2 = <Locale extends string, R>(
Expand Down Expand Up @@ -60,7 +60,7 @@ export const makeClient2 = <Locale extends string, R>(
R,
Args extends unknown[]
>(
f: (...args: Args) => Effect<A, E, R>,
f: Effect<A, E, R> | ((...args: Args) => Effect<A, E, R>),
action: string,
options: Opts<A> = { suppressErrorToast: false }
) {
Expand All @@ -77,9 +77,8 @@ export const makeClient2 = <Locale extends string, R>(
{ id: "handle.with_errors" },
{ action: message }
)
return Object.assign(
flow(
f,
const handleEffect = (self: Effect<A, E, R>) =>
self.pipe(
Effect.exit,
Effect.tap(
Exit.matchEffect({
Expand Down Expand Up @@ -143,7 +142,17 @@ export const makeClient2 = <Locale extends string, R>(
})
})
)
),
)
return Object.assign(
Effect.isEffect(f)
? pipe(
f,
handleEffect
)
: flow(
f,
handleEffect
),
{ action }
)
}
Expand Down

0 comments on commit 0677419

Please sign in to comment.