# j-Notify

> j-Notify: los errores se manejan automáticamente

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: es
Content-SHA256: d1ae09823ac12afe970620f86ff5435dc1b6b8bb8e48f0b8ba55737c70f1f4b9
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

__Configuración__:

- `timeout {Number}` debe contener un tiempo de espera (milisegundos) para el vencimiento de la notificación (predeterminado: `3000`)
- `position {String}` puede ser `top`, `top left`, `top right` (predeterminado), `bottom`, `bottom left` y `bottom right`.

__Métodos__:

```js
SETTER('notify/warning', 'Some warning');
SETTER('notify/success', 'Some success message');
SETTER('notify/info', 'Some info message');
```

__Funciona con ASETTER__:

- los errores se manejan automáticamente

```js
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully'));

// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully', function(response) {
	console.log(response);
}));

// Or with a callback and without notify
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', function(response) {
	console.log(response);
}));

// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Your message', '?.response'));
```

Úselo con `<ui-component name="notify">`. Cuando el componente aún no está cargado, jComponent lo descarga en el primer uso desde la dirección en `DEF.fallback` (el CDN Componentator de forma predeterminada). Autor: Peter Širka. Fuente: repositorio de componentes Componentator, licencia MIT.

```html example.html
<style>
	body { font-family: Arial; background-color: #F5F5F5; }
</style>

<ui-component name="notify"></ui-component>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia harum accusamus debitis aut sunt, deserunt magni alias neque unde reprehenderit ipsa ea laboriosam eveniet! Distinctio pariatur sed, a aut nobis.

<script>
	setTimeout(function() {
		SETTER('notify/success', 'This is "success" message.');
	}, 1000);

	setTimeout(function() {
		SETTER('notify/warning', 'This is "warning" message.', 2);
	}, 2000);

	setTimeout(function() {
		SETTER('notify/info', 'This is "info" message.', 3);
	}, 3000);
</script>
```
