This commit is contained in:
@@ -272,7 +272,7 @@ export class Reffuse<R> {
|
||||
|
||||
const setValue = React.useCallback((setStateAction: React.SetStateAction<A>) =>
|
||||
runSync(Ref.update(ref, previousState =>
|
||||
SetStateAction.get(setStateAction, previousState)
|
||||
SetStateAction.value(setStateAction, previousState)
|
||||
)),
|
||||
[ref])
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Function } from "effect"
|
||||
import type React from "react"
|
||||
|
||||
|
||||
export const get: {
|
||||
export const value: {
|
||||
<S>(prevState: S): (setStateAction: React.SetStateAction<S>) => S
|
||||
<S>(setStateAction: React.SetStateAction<S>, prevState: S): S
|
||||
} = Function.dual(2, <S>(self: React.SetStateAction<S>, prevState: S): S =>
|
||||
|
||||
Reference in New Issue
Block a user