Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created September 19, 2022 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/c1db12e41e775ecf1589fab2103df977 to your computer and use it in GitHub Desktop.
Save NetanelBasal/c1db12e41e775ecf1589fab2103df977 to your computer and use it in GitHub Desktop.
import { ENVIRONMENT_INITIALIZER, Provider } from '@angular/core';
export function attachInitEffect(fn: VoidFunction): Provider {
return {
multi: true,
provide: ENVIRONMENT_INITIALIZER,
useValue: fn,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment