public componentDidMount()

in client/components/mma/shared/AsyncLoader.tsx [43:63]


	public componentDidMount(): void {
		this.props
			.fetch()
			.then((resp) =>
				Array.isArray(resp)
					? Promise.all(resp.map(this.processResponse))
					: this.processResponse(resp),
			)
			.then((data) => {
				if (
					!(
						this.props.shouldPreventRender &&
						this.props.shouldPreventRender(data)
					) &&
					data !== null
				) {
					this.setState({ data, loadingState: LoadingState.Loaded });
				}
			})
			.catch((exception) => this.handleError(exception));
	}