Skip to content

Commit 2eb703d

Browse files
committed
Allow Trace effect inside React methods
1 parent bfa3f21 commit 2eb703d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/React.purs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module React where
22

3+
import Debug.Trace
34
import Control.Monad.Eff
45

56
foreign import data DOM :: !
@@ -24,13 +25,15 @@ module React where
2425

2526
type ReadProps eff props result = Eff (
2627
p :: ReadPropsEff props,
27-
dom :: DOM
28+
dom :: DOM,
29+
trace :: Trace
2830
) result
2931

3032
type ReadState eff props state result = Eff (
3133
p :: ReadPropsEff props,
3234
r :: ReadStateEff state,
33-
dom :: DOM
35+
dom :: DOM,
36+
trace :: Trace
3437
) result
3538

3639
type ReadWriteState eff props state result = Eff (
@@ -42,14 +45,16 @@ module React where
4245

4346
type Render props state = Eff (
4447
p :: ReadPropsEff props,
45-
r :: ReadStateEff state
48+
r :: ReadStateEff state,
49+
trace :: Trace
4650
) UI
4751

4852
type ShouldComponentUpdate props state =
4953
props -> state -> Eff (
5054
p :: ReadPropsEff props,
5155
r :: ReadStateEff state,
52-
w :: WriteStateEff state
56+
w :: WriteStateEff state,
57+
trace :: Trace
5358
) Boolean
5459

5560
type UISpec eff props state =

0 commit comments

Comments
 (0)