HashChange

The component captures all changes for #hashtag in the URL address.

Live preview

Open in new tab ↗

The component captures all changes for #hashtag in the URL address. When change, it emits event hash. The component reacts to the real changes.

  • singleton

Configuration:

  • delay {Number} a delay for emitting hash event (default: 0)
  • NEW: middleware {String} a middleware (separated by the comma) for initial emit of the hash event

How to capture hash change?

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

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

});

More UI components

Browse all 348