Skip to content

useEffect unstable view source

function useEffect<Scope>(
  scope: Fusion.Scope<S & typeof(Fusion)>,
  callback: (Fusion.Use, Fusion.Scope<S>) -> ()
)

Perform side effects with state objects.

Not recommended for production usage

This API has not been stablized. It's call signature may be altered in the future, it may throw bugs, or it may be outright removed in later releases. Use at your own risk.


Parameters

scope : Fusion.Scope<S & typeof(Fusion)>

The scope to store cleanup tasks.

callback : (Fusion.Use, Fusion.Scope<S>) -> ()

A callback with a Use callback for tracking side effects and an inner scope scope to track cleanup tasks. This callback may not yield.


Example Usage

-- TODO: write example