File tree Expand file tree Collapse file tree 5 files changed +38
-0
lines changed
generated-docs/React/Basic Expand file tree Collapse file tree 5 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 3838div { style: css { padding: "5px" } } [ text "This text is padded." ]
3939```
4040
41+ #### ` mergeStyles `
42+
43+ ``` purescript
44+ mergeStyles :: Array CSS -> CSS
45+ ```
46+
47+ Merge styles from right to left. Uses ` Object.assign ` .
48+
49+ E.g.
50+
51+ ```
52+ style: mergeCSS [ (css { padding: "5px" }), props.style ]
53+ ```
54+
4155#### ` SharedProps `
4256
4357``` purescript
Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ input { onChange: handler_ (setState \_ -> { value })
8484 }
8585```
8686
87+ #### ` syntheticEvent `
88+
89+ ``` purescript
90+ syntheticEvent :: EventFn SyntheticEvent SyntheticEvent
91+ ```
92+
8793#### ` merge `
8894
8995``` purescript
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ exports . mergeStyles = function ( styles ) {
4+ return Object . assign . apply ( null , [ { } ] . concat ( styles ) ) ;
5+ } ;
Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ foreign import data CSS :: Type
2929css :: forall css . { | css } -> CSS
3030css = unsafeCoerce
3131
32+ -- | Merge styles from right to left. Uses `Object.assign`.
33+ -- |
34+ -- | E.g.
35+ -- |
36+ -- | ```
37+ -- | style: mergeCSS [ (css { padding: "5px" }), props.style ]
38+ -- | ```
39+ foreign import mergeStyles :: Array CSS -> CSS
40+
3241-- | Standard props which are shared by all DOM elements.
3342type SharedProps specific =
3443 -- | `key` is not really a DOM attribute - React intercepts it
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ module React.Basic.Events
55 , unsafeEventFn
66 , handler
77 , handler_
8+ , syntheticEvent
89 , merge
910 , class Merge
1011 , mergeImpl
@@ -72,6 +73,9 @@ handler (EventFn fn) cb = mkEffFn1 $ fn >>> cb
7273handler_ :: Eff (react :: ReactFX ) Unit -> EventHandler
7374handler_ = mkEffFn1 <<< const
7475
76+ syntheticEvent :: EventFn SyntheticEvent SyntheticEvent
77+ syntheticEvent = id
78+
7579class Merge (rl :: RowList ) fns a r | rl -> fns , rl a -> r where
7680 mergeImpl :: RLProxy rl -> Record fns -> EventFn a (Record r )
7781
You can’t perform that action at this time.
0 commit comments