> For the complete documentation index, see [llms.txt](https://henryruhs.gitbook.io/ngx-crud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://henryruhs.gitbook.io/ngx-crud/examples/effects/offlineeffect.md).

# OfflineEffect

Show an warning message when offline and prevent requests being sent:

```typescript
import { Injectable } from '@angular/core';
import { HttpRequest } from '@angular/common/http';
import { ObserveBeforeEffect } from 'ngx-crud';

import { NotifierService } from './notifier.service';

@Injectable()
export class OfflineEffect implements ObserveBeforeEffect
{
	constructor(protected notifierService : NotifierService) {}

	before<T>(request : HttpRequest<T>) : HttpRequest<T>
	{
		if (navigator.onLine)
		{
			return request;
		}
		notifierService.warning('OFFLINE_MODE');
	}
}
```
