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