react-flux 1.2.0 → 1.2.1
raw patch · 4 files changed
+16/−3 lines, 4 files
Files
- ChangeLog.md +5/−0
- react-flux.cabal +1/−1
- src/React/Flux/Ajax.hs +3/−1
- src/React/Flux/Views.hs +7/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+# 1.2.1++* A few fixes to get the haddock documentation (hopefully) working on hackage, no functional+ change to any code in this release.+ # 1.2.0 * (Breaking Change) Add timeout support to the AJAX functionality. This has three changes. First, the AJAX code moved
react-flux.cabal view
@@ -1,5 +1,5 @@ name: react-flux-version: 1.2.0+version: 1.2.1 synopsis: A binding to React based on the Flux application architecture for GHCJS category: Web homepage: https://bitbucket.org/wuzzeb/react-flux
src/React/Flux/Ajax.hs view
@@ -33,9 +33,11 @@ -- response handler executes. data RequestTimeout = TimeoutMilliseconds Int | NoTimeout +#ifdef __GHCJS__ instance ToJSVal RequestTimeout where toJSVal (TimeoutMilliseconds i) = toJSVal i toJSVal NoTimeout = pure jsNull+#endif -- | The input to an AJAX request built using @XMLHttpRequest@. data AjaxRequest = AjaxRequest@@ -194,7 +196,7 @@ Error e -> handler $ Left (500, T.pack e) else handler $ Left (respStatus resp, JSS.textFromJSString $ respResponseText resp) #else-jsonAjax _ _ _ _ _ = return ()+jsonAjax _ _ _ _ _ _ = return () #endif #ifdef __GHCJS__
src/React/Flux/Views.hs view
@@ -109,6 +109,12 @@ -- 'viewWithSKey' and 'viewWithIKey'. The key property allows React to more easily reconcile the virtual DOM with the -- browser DOM. --+-- Due to React limitations (see <https://github.com/facebook/react/issues/2127 issue2127>), React+-- views must have a single top-level element. If your haskell code returns multiple top-level+-- elements, react-flux will wrap them in a container @div@. You should not rely on this and instead+-- make sure each view returns only a single top-level element (such as @todoItem@ below returning only+-- a single @li@ element).+-- -- The following is two example views: @mainSection_@ is just a Haskell function and @todoItem@ -- is a React view. We use the convention that an underscore suffix signifies a combinator -- which can be used in the rendering function.@@ -129,7 +135,7 @@ -- > li_ [ classNames [("completed", todoComplete todo), ("editing", todoIsEditing todo)] -- > , "key" @= todoIdx -- > ] $ do--- > +-- > -- > div_ [ "className" $= "view"] $ do -- > input_ [ "className" $= "toggle" -- > , "type" $= "checkbox"