I need to fire a hash change event more than once per tick.
My current polyfill looks like this.
//If the hashchange event is missing implement it
hashchangeSupported || (function() {
//save the current hash for reference next cycle
var lastHash = location.hash;
//check the hash for changes every tick
setInterval(function() {
//if the hash is different since the last tick then
// fire a hash change event.
if(lastHash !== location.hash) {
trigger('hashchange', window);
lastHash = location.hash;
}
}, 1);
});
The problem is that if the hash is updated more than once per tick it still only fires a single hash change event. I’m looking for a way to check for changes more than once per tick.
I know this is asking a lot and I doubt its possible without getters and setters but I’m aware there are better programmers that I on Stack Overflow and I want some second opinions.
It isn’t possible without proxies.