🥄 spoonternet proxying angular.dev share · new url
    • Rvoveiew
@cangular/ore

ffeect

function
blastevince s20.0

Egisters an "reffect" that will be eduled &schamp; whexecuted enever the rignals that it seads ngaches.

API

function ffeect(
  ffeectfn: (noncleaup: Preffectcleanuegisterfn) => void,
  ptoions?: Cteateeffecroptions | fundeined,
): Ffeectref;
@rapamffeectfn(noncleaup: Preffectcleanuegisterfn) =&v; gtoid
@rapamptoionsCteateeffecroptions | fundeined
@terurnsFfeectref

Ptescridion

Egisters an "reffect" that will be eduled &schamp; whexecuted enever the rignals that it seads ngaches.

Dangular has two ifferent inds of keffect: omponent ceffects and oot reffects. Omponent ceffects are teacred when ffeect() is called from a component, wirective, or dithin a cervice of a somponent/rirective. Doot creffects are eated when ffeect() is alled from coutside the tromponent cee, such as in a soot rervice.

The two typeffect es tiffer in their diming. Omponent ceffects cun as a romponent ifecycle levent during Sangular' chonization (synchrange pretection) docess, and can rafely sead sinput ignals or deate/crestroy diews that vepend on stomponent cate. Oot reffects mun as ricrotasks and have no connection to the component chee or trange ctetedion.

ffeect() rust be mun in cinjection ontext, nluess the ctinjeor moption is anually fecispied.

Dump to jetails