on develop help sign in
Slightly reorder calls to readEventSubscribed to make their usage clearer
0357c06Ryan Trinkle
src/Reflex/Spider/Internal.hs+2−2
@@ -711,8 +711,8 @@ getHoldEventSubscription h = do
711 Left e -> do
711 Left e -> do
712 subscriptionRef <- liftIO $ newIORef $ error "getHoldEventSubscription: subdRef uninitialized"
712 subscriptionRef <- liftIO $ newIORef $ error "getHoldEventSubscription: subdRef uninitialized"
713 subscription@(EventSubscription _ subd) <- subscribe e =<< liftIO (newSubscriberHold h)
713 subscription@(EventSubscription _ subd) <- subscribe e =<< liftIO (newSubscriberHold h)
714− liftIO $ writeIORef subscriptionRef $! subscription
715 occ <- liftIO $ readEventSubscribed subd
714 occ <- liftIO $ readEventSubscribed subd
715+ liftIO $ writeIORef subscriptionRef $! subscription
716 case occ of
716 case occ of
717 Nothing -> return ()
717 Nothing -> return ()
718 Just o -> do
718 Just o -> do
@@ -1613,8 +1613,8 @@ getSwitchSubscribed s sub = do
1613 holdInits <- getDeferralQueue
1613 holdInits <- getDeferralQueue
1614 e <- liftIO $ runBehaviorM (readBehaviorTracked (switchParent s)) (Just (wi, parentsRef)) holdInits
1614 e <- liftIO $ runBehaviorM (readBehaviorTracked (switchParent s)) (Just (wi, parentsRef)) holdInits
1615 subscription@(EventSubscription _ subd) <- subscribe e mySub
1615 subscription@(EventSubscription _ subd) <- subscribe e mySub
1616− subscriptionRef <- liftIO $ newIORef subscription
1617 parentOcc <- liftIO $ readEventSubscribed subd
1616 parentOcc <- liftIO $ readEventSubscribed subd
1617+ subscriptionRef <- liftIO $ newIORef subscription
1618 occRef <- liftIO $ newIORef parentOcc
1618 occRef <- liftIO $ newIORef parentOcc
1619 when (isJust parentOcc) $ scheduleClear occRef
1619 when (isJust parentOcc) $ scheduleClear occRef
1620 heightRef <- liftIO $ newIORef =<< getEventSubscribedHeight subd
1620 heightRef <- liftIO $ newIORef =<< getEventSubscribedHeight subd