@@ -22,7 +22,6 @@ import Data.Maybe
22import Data.IntMap (IntMap)
22import Data.IntMap (IntMap)
23import qualified Data.IntMap as IntMap
23import qualified Data.IntMap as IntMap
24import Control.Lens hiding (coerce)
24import Control.Lens hiding (coerce)
25−import Control.Monad.TypedId
26import Control.Monad.Ref
25import Control.Monad.Ref
27import Data.Monoid ((<>))
26import Data.Monoid ((<>))
@@ -452,6 +451,7 @@ newRoot = do
452 , rootInit = const $ return $ return ()
451 , rootInit = const $ return $ return ()
454+propagateAndUpdateSubscribersRef :: IORef [WeakSubscriber a] -> a -> EventM ()
455propagateAndUpdateSubscribersRef subscribersRef a = do
455propagateAndUpdateSubscribersRef subscribersRef a = do
456 subscribers <- liftIO $ readIORef subscribersRef
456 subscribers <- liftIO $ readIORef subscribersRef
457 liftIO $ writeIORef subscribersRef []
457 liftIO $ writeIORef subscribersRef []
@@ -1278,13 +1278,6 @@ instance R.MonadReadEvent Spider ResultM where
1278 {-# INLINE readEvent #-}
1278 {-# INLINE readEvent #-}
1279 readEvent = liftM (fmap return) . readEvent . unSpiderEvent
1279 readEvent = liftM (fmap return) . readEvent . unSpiderEvent
1281−--TODO: Can probably get rid of this now that we're not using it for performEvent
1282−instance MonadTypedId EventM where
1283− type TypedId EventM = TypedId IO
1284− {-# INLINE getTypedId #-}
1288instance MonadRef EventM where
1281instance MonadRef EventM where
1289 type Ref EventM = Ref IO
1282 type Ref EventM = Ref IO
1290 {-# INLINE newRef #-}
1283 {-# INLINE newRef #-}
@@ -1307,7 +1300,8 @@ instance R.MonadHold Spider SpiderHostFrame where
1307 {-# INLINE hold #-}
1300 {-# INLINE hold #-}
1308 hold v0 e = SpiderHostFrame $ R.hold v0 e
1301 hold v0 e = SpiderHostFrame $ R.hold v0 e
1310−newEventWithTriggerIO f= do
1303+newEventWithTriggerIO :: (RootTrigger a -> IO (IO ())) -> IO (R.Event Spider a)
1304+newEventWithTriggerIO f = do
1311 occRef <- newIORef Nothing
1305 occRef <- newIORef Nothing
1312 subscribedRef <- newIORef Nothing
1306 subscribedRef <- newIORef Nothing
1313 let !r = Root
1307 let !r = Root