Skip to content

Commit 39fddc1

Browse files
committed
Add transformState function
1 parent d1dd856 commit 39fddc1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/React.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ module React where
118118
\ }"
119119
:: forall state eff. Eff (r :: ReadStateEff state | eff) state
120120

121+
transformState f = do
122+
state <- readState
123+
writeState $ f state
124+
121125
foreign import getSelf
122126
" function getSelf() { \
123127
\ return __current; \

0 commit comments

Comments
 (0)