RAN025 hydrateWith with queued commits
error RAN025: Hydration supports synchronous commits only, so this call raises.
Cause. hydrateWith raises NotSupportedException "Hydration supports synchronous commits only" for QueuedCommits. The rule reports a first argument that evaluates to a QueuedCommits construction or a call of Microtask.mode, directly or through a local, a module-level value, a function defined in the same file, or either branch of an if or match.
Fix. Pass SynchronousCommits, or call hydrate.
Triggers
module Example
open Ranvier
open Ranvier.View
open Ranvier.View.Dom.Scheduling
open Ranvier.View.Dom.Hydration
let hydrated graph host definition (failure: CommitFailure) (post: (unit -> unit) -> unit) =
hydrateWith (QueuedCommits (failure, post)) graph None ignore HydrationOptions.defaults host definition ()
Fixed
module Example
open Ranvier
open Ranvier.View
open Ranvier.View.Dom.Scheduling
open Ranvier.View.Dom.Hydration
let hydrated graph host definition =
hydrateWith SynchronousCommits graph None ignore HydrationOptions.defaults host definition ()
Suppression. // fsharpanalyzer: ignore-line RAN025, with the reason on the line before.