Another question regarding `workflow`, how does sq...
# squarelibraries
v
Another question regarding
workflow
, how does square handle events which need to be consumed exactly once (analytics)?
r
Worker.createSideEffect
We’ve also been known to just do the side effect straight from the event handler function, but that’s a bit racy.
👍 1
z
Depends on what triggers your side effect: - if triggered by a state change, use a worker as Ray suggested. - if triggered by a
WorkflowAction
(rendering event handler or child/worker output), do the side effect in the action. Note that this is not racy, what ray is referring to is performing the side effect from the lambda that returns the action. Side effects are safe from the action itself.
👍 1
v
thanks