For example,
// change hash if needed
api[ 'setHash' ] = function(hash) {
api[ 'setHashLocker' ] = true;
if (hash !== window.location.hash) {
window.location.hash = hash;
};
setTimeout(function(){
api[ 'setHashLocker' ] = false;
}, 400);
};
var app = $.sammy('#foo', function() {
this.get('#!/home', function() {
if(api[ 'setHashLocker' ] === true){
return;
};
/* your usual code goes here */
};
};