# j-HashChange

> Il componente cattura tutti i cambiamenti per #hashtag nell'indirizzo URL. Quando cambia, emette hash eventi.

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

Il componente cattura tutti i cambiamenti di `#hashtag` nell'indirizzo URL. Quando cambia, emette evento `hash`.

- singolo

__Configurazione__:

- `delay {Number}` un ritardo per l'emissione di eventi `hash` (default: `0`)
- __NEW__: `middleware {String}` un middleware (spezzato dal comma) per l'emissione iniziale dell'evento `hash`

__Come si fa a catturare il hash?__

```js
// Global:
ON('hash', function(hash) {
	// @hash {String} - it can be "empty"
});

// Or in the Plugin declaration:
exports.on('hash', function(hash) {

});
```

Utilizzare con `<ui-component name="hashchange">`Quando il componente non è ancora caricato, jComponent Scarica il codice in prima utilizzazione dall'indirizzo `DEF.fallback` (Il Componentator La storia di Peter Širka.Fonte: il Componentator Ristorante dei componenti, licenza MIT.

```html example.html
<ui-component name="hashchange"></ui-component>

<ui-bind path="currenthash" config="text"></ui-bind>

<script>

	setInterval(() => location.hash = GUID(10), 1000);

	ON('hash', function(hash) {
		SET('currenthash', hash);
	});

</script>
```
