We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This will not work
it('before-request - without delay', function() { var requests = 0 window.foo = 0 this.server.respondWith('GET', '/test', function(xhr) { requests++ xhr.respond(200, {}, 'Requests: ' + requests) }) var div = make('<div hx-trigger="load, click" hx-get="/test" hx-on:htmx:before-request="window.foo += 1">Requests: 0</div>') div.innerHTML.should.equal('Requests: 0') this.server.respond() div.innerHTML.should.equal('Requests: 1') div.click() this.server.respond() div.innerHTML.should.equal('Requests: 2') delete window.foo window.foo.should.equal(2) })
When usind delay:1 it will work.
it('before-request - with delay', function(done) { var requests = 0 window.foo = 0 this.server.respondWith('GET', '/test', function(xhr) { requests++ xhr.respond(200, {}, 'Requests: ' + requests) }) var div = make('<div hx-trigger="load delay:1ms" hx-get="/test" hx-on:htmx:before-request="window.foo += 1">Requests: 0</div>') div.innerHTML.should.equal('Requests: 0') this.server.autoRespond = true this.server.autoRespondAfter = 5 setTimeout(function() { window.foo.should.equal(1) delete window.foo div.innerHTML.should.equal('Requests: 1') done() }, 50) })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This will not work
When usind delay:1 it will work.
The text was updated successfully, but these errors were encountered: