11-- | This module defines foreign types and functions which wrap React's functionality.
22
3- module React
3+ module React
44 ( UI ()
55 , UIRef ()
6-
6+
77 , EventHandler ()
8-
8+
99 , Disallowed ()
1010 , Read ()
1111 , Write ()
1212 , Only ()
1313 , ReadWrite ()
1414 , ReadOnly ()
15-
15+
1616 , ReactState ()
1717 , ReactProps ()
1818 , ReactRefs ()
19-
19+
2020 , Refs ()
21-
21+
2222 , Render ()
23-
23+
2424 , UISpec ()
25-
25+
2626 , Event ()
2727 , MouseEvent ()
2828 , KeyboardEvent ()
29-
29+
3030 , EventHandlerContext ()
31-
31+
3232 , spec
33-
33+
3434 , getProps
3535 , getRefs
36-
36+
3737 , readState
3838 , writeState
3939 , transformState
40-
40+
4141 , mkUI
42-
42+
4343 , handle
44-
44+
4545 , renderToString
4646 , renderToBody
4747 , renderToElementById
@@ -103,13 +103,13 @@ foreign import data Refs :: *
103103foreign import data Event :: *
104104
105105-- | The type of mouse events.
106- type MouseEvent =
106+ type MouseEvent =
107107 { pageX :: Number
108- , pageY :: Number
108+ , pageY :: Number
109109 }
110110
111111-- | The type of keyboard events.
112- type KeyboardEvent =
112+ type KeyboardEvent =
113113 { altKey :: Boolean
114114 , ctrlKey :: Boolean
115115 , charCode :: Int
@@ -124,7 +124,7 @@ type KeyboardEvent =
124124 }
125125
126126-- | A function which handles events.
127- type EventHandlerContext eff props state result =
127+ type EventHandlerContext eff props state result =
128128 Eff ( props :: ReactProps props
129129 , refs :: ReactRefs ReadOnly
130130 , state :: ReactState ReadWrite state
@@ -216,30 +216,30 @@ spec st render =
216216 }
217217
218218-- | Read the component props.
219- foreign import getProps :: forall props eff .
220- UIRef ->
219+ foreign import getProps :: forall props eff .
220+ UIRef ->
221221 Eff (props :: ReactProps props | eff ) props
222222
223223-- | Read the component refs.
224224foreign import getRefs :: forall write eff .
225- UIRef ->
225+ UIRef ->
226226 Eff (refs :: ReactRefs (Read write ) | eff ) Refs
227227
228228-- | Write the component state.
229- foreign import writeState :: forall state eff .
230- UIRef ->
231- state ->
229+ foreign import writeState :: forall state eff .
230+ UIRef ->
231+ state ->
232232 Eff (state :: ReactState ReadWrite state | eff ) state
233233
234234-- | Read the component state.
235- foreign import readState :: forall state write eff .
235+ foreign import readState :: forall state write eff .
236236 UIRef ->
237237 Eff (state :: ReactState (Read write ) state | eff ) state
238238
239239-- | Transform the component state by applying a function.
240- transformState :: forall state statePerms eff .
240+ transformState :: forall state statePerms eff .
241241 UIRef ->
242- (state -> state ) ->
242+ (state -> state ) ->
243243 Eff (state :: ReactState ReadWrite state | eff ) state
244244transformState ctx f = do
245245 state <- readState ctx
@@ -248,7 +248,7 @@ transformState ctx f = do
248248-- | Create a component from a component spec.
249249foreign import mkUI :: forall props state eff .
250250 UISpec props state eff ->
251- props ->
251+ props ->
252252 UI
253253
254254-- | Create an event handler.
0 commit comments