You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/React.md
+57-19Lines changed: 57 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -29,35 +29,63 @@ An event handler. The type argument represents the type of the event.
29
29
#### `Disallowed`
30
30
31
31
```purescript
32
-
data Disallowed :: !
32
+
data Disallowed
33
33
```
34
34
35
-
This phantom effect indicates that both read and write access to a resource are disallowed.
35
+
This phantom type indicates that both read and write access to a resource are disallowed.
36
36
37
-
#### `ReadAllowed`
37
+
#### `Read`
38
38
39
39
```purescript
40
-
data ReadAllowed :: !
40
+
data Read write
41
41
```
42
42
43
-
This phantom effect indicates that only read access to a resource is allowed.
43
+
This phantom type indicates that read access to a resource is allowed.
44
44
45
-
#### `WriteAllowed`
45
+
#### `Write`
46
46
47
47
```purescript
48
-
data WriteAllowed :: !
48
+
data Write
49
49
```
50
50
51
-
This phantom effect indicates that only write access to a resource is allowed.
51
+
This phantom type indicates that write access to a resource is allowed.
52
+
53
+
#### `Only`
54
+
55
+
```purescript
56
+
data Only
57
+
```
58
+
59
+
This phantom type indicates that only read access to a resource is allowed.
60
+
61
+
#### `ReadWrite`
62
+
63
+
```purescript
64
+
type ReadWrite = Read Write
65
+
```
66
+
67
+
An access synonym which indicates that both read and write access are allowed.
68
+
69
+
#### `ReadOnly`
70
+
71
+
```purescript
72
+
type ReadOnly = Read Only
73
+
```
74
+
75
+
An access synonym which indicates that reads are allowed but writes are not.
52
76
53
77
#### `ReactState`
54
78
55
79
```purescript
56
-
data ReactState :: # ! -> * -> !
80
+
data ReactState :: * -> * -> !
57
81
```
58
82
59
83
This effect indicates that a computation may read or write the component state.
60
84
85
+
The first type argument is either `ReadWrite`, `ReadOnly` or `Disallowed` dependeding on the context.
86
+
87
+
The second type argument is the type of the state of the component.
88
+
61
89
#### `ReactProps`
62
90
63
91
```purescript
@@ -74,6 +102,16 @@ data ReactRefs :: * -> !
74
102
75
103
This effect indicates that a computation may read the component refs.
76
104
105
+
The first type argument is either `ReadOnly` or `Disallowed` dependeding on the context.
106
+
107
+
#### `Refs`
108
+
109
+
```purescript
110
+
data Refs :: *
111
+
```
112
+
113
+
The type of refs objects.
114
+
77
115
#### `Event`
78
116
79
117
```purescript
@@ -101,31 +139,31 @@ The type of keyboard events.
101
139
#### `EventHandlerContext`
102
140
103
141
```purescript
104
-
type EventHandlerContext eff props refs state result = Eff (props :: ReactProps props, refs :: ReactRefs refs, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed) state | eff) result
142
+
type EventHandlerContext eff props state result = Eff (props :: ReactProps props, refs :: ReactRefs ReadOnly, state :: ReactState ReadWrite state | eff) result
105
143
```
106
144
107
145
A function which handles events.
108
146
109
147
#### `Render`
110
148
111
149
```purescript
112
-
type Render props refs state eff = UIRef -> Eff (props :: ReactProps props, refs :: Disallowed, state :: ReactState (read :: ReadAllowed) state | eff) UI
150
+
type Render props state eff = UIRef -> Eff (props :: ReactProps props, refs :: ReactRefs Disallowed, state :: ReactState ReadOnly state | eff) UI
0 commit comments