Skip to content

Commit

Permalink
Make the Prerender instance for QueryT less strict
Browse files Browse the repository at this point in the history
This prevents some event loops
  • Loading branch information
ryantrinkle committed Aug 22, 2023
1 parent a9338c2 commit 9886453
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reflex-dom-core/src/Reflex/Dom/Prerender.hs
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ instance (Prerender t m, MonadFix m, Reflex t) => Prerender t (RequesterT t requ

instance (Prerender t m, Monad m, Reflex t, MonadFix m, Group q, Commutative q, Query q, Eq q) => Prerender t (QueryT t q m) where
type Client (QueryT t q m) = QueryT t q (Client m)
prerender server client = mdo
result <- queryDyn query
prerender server client = do
result <- askQueryResult
x <- lift $ prerender (runQueryT server result) (runQueryT client result)
let (a, inc) = splitDynPure x
query = incrementalToDynamic =<< inc -- Can we avoid the incrementalToDynamic?
tellQueryDyn $ incrementalToDynamic =<< inc -- Can we avoid the incrementalToDynamic?
pure a

instance (Prerender t m, Monad m) => Prerender t (InputDisabledT m) where
Expand Down

0 comments on commit 9886453

Please sign in to comment.