Hi Daniel, 2012/2/14 Daniel Bünzli > Le mardi, 14 février 2012 à 11:02, Philippe Veber a écrit : > > > In other words, am I allowed to call a primitive in a lifted function? > No. This is documented here [1]. Well I did read the paragraph, but thought the described limitation might be about updating a signal from different threads. Of course it makes sense that even in a single-threaded code, an update cycle should not be interrupted by another if there are shared dependencies. May I nevertheless humbly suggest to add the "not calling a primitive inside a lifted function" rule more explicitely, as it is a tempting sin for a beginner? > One way to side-step the issue is to put these updates in a queue and > execute them after the update cycle ended. > That seems a good work-around, to gather all side-effects in one place, namely a (unit -> unit) Queue.t where to defer all calls to the primitives. That do help, thanks ! ph. > Best, > > Daniel > > [1] http://erratique.ch/software/react/doc/React#update >