on develop help sign in
Merge pull request #321 from alexfmpe/ae-relax-constraints
acc5035Ali Abrar
reflex-dom-core/ChangeLog.md+1
@@ -8,6 +8,7 @@
8* Reintroduce "data-ssr": elements without this attribute are skipped during
8* Reintroduce "data-ssr": elements without this attribute are skipped during
9 hydration.
9 hydration.
10* Fix an issue in the hydration tests that prevented the test from finding the chromium executable
10* Fix an issue in the hydration tests that prevented the test from finding the chromium executable
11+* Relax constraints on `dyn` and `widgetHold` to match the ones in `networkView` and `networkHold` respectively
11
12
12## 0.5.1
13## 0.5.1
13
14
reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs+5−4
@@ -60,6 +60,7 @@ module Reflex.Dom.Widget.Basic
60 , partitionMapBySetLT
60 , partitionMapBySetLT
61 ) where
61 ) where
62
62
63+import Reflex.Adjustable.Class
63import Reflex.Class
64import Reflex.Class
64import Reflex.Collection
65import Reflex.Collection
65import Reflex.Dom.Builder.Class
66import Reflex.Dom.Builder.Class
@@ -146,21 +147,21 @@ button t = do
146-- | Given a Dynamic of widget-creating actions, create a widget that is recreated whenever the Dynamic updates.
147-- | Given a Dynamic of widget-creating actions, create a widget that is recreated whenever the Dynamic updates.
147-- The returned Event of widget results occurs when the Dynamic does.
148-- The returned Event of widget results occurs when the Dynamic does.
148-- Note: Often, the type @a@ is an 'Event', in which case the return value is an Event-of-Events that would typically be flattened (via 'switchHold').
149-- Note: Often, the type @a@ is an 'Event', in which case the return value is an Event-of-Events that would typically be flattened (via 'switchHold').
149−dyn :: (DomBuilder t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
150+dyn :: (Adjustable t m, NotReady t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
150dyn = networkView
151dyn = networkView
151
152
152-- | Like 'dyn' but discards result.
153-- | Like 'dyn' but discards result.
153−dyn_ :: (DomBuilder t m, PostBuild t m) => Dynamic t (m a) -> m ()
154+dyn_ :: (Adjustable t m, NotReady t m, PostBuild t m) => Dynamic t (m a) -> m ()
154dyn_ = void . dyn
155dyn_ = void . dyn
155
156
156-- | Given an initial widget and an Event of widget-creating actions, create a widget that is recreated whenever the Event fires.
157-- | Given an initial widget and an Event of widget-creating actions, create a widget that is recreated whenever the Event fires.
157-- The returned Dynamic of widget results occurs when the Event does.
158-- The returned Dynamic of widget results occurs when the Event does.
158-- Note: Often, the type 'a' is an Event, in which case the return value is a Dynamic-of-Events that would typically be flattened (via 'switchDyn').
159-- Note: Often, the type 'a' is an Event, in which case the return value is a Dynamic-of-Events that would typically be flattened (via 'switchDyn').
159−widgetHold :: (DomBuilder t m, MonadHold t m) => m a -> Event t (m a) -> m (Dynamic t a)
160+widgetHold :: (Adjustable t m, MonadHold t m) => m a -> Event t (m a) -> m (Dynamic t a)
160widgetHold = networkHold
161widgetHold = networkHold
161
162
162-- | Like 'widgetHold' but discards result.
163-- | Like 'widgetHold' but discards result.
163−widgetHold_ :: (DomBuilder t m, MonadHold t m) => m a -> Event t (m a) -> m ()
164+widgetHold_ :: (Adjustable t m, MonadHold t m) => m a -> Event t (m a) -> m ()
164widgetHold_ z = void . widgetHold z
165widgetHold_ z = void . widgetHold z
165
166
166-- | Create a DOM element
167-- | Create a DOM element