Tag: javascript
Just a quick snippet about how to do polling the Svelte way.
import { onDestroy } from "svelte"
let interval
const poll = () => {
clearTimeout(interval)
Inertia.reload()
interval = setTimeout(poll, 1000)
}
poll()
onDestroy(() => clearTimeout(interval))
…
Using Drag & Drop is probably easier than ever due to virtually unlimited
supply of new front-end libraries appearing every day. Making Drag & Drop
for a sortable trello-like boards or for file uploads work in the browser
is thus becoming a matter of importing a module an…
A short snippet that makes it possible to test if
preserveScroll feature
is enabled in InertiaJS. Can be used as a part of Test-Driven Development
process (TDD). The snippet can probably be adapted for other scroll related
tests, but is especially geared towards the InertiaJS fea…
I've made a macro for the Illuminate\Testing\TestResponse class that I
put into the TestCase.php file which is
a part of pingcrm-svelte.
I currently use this short macro in basically all HTTP tests for Inertia
related endpoints in Laravel, so unless I am doing something wrong, it…
InertiaJS is a really impressive approach to building fullstack web
applications. I've probably first heard about it in the Javascript Jabber
from devchat.tv in
episode 443.
Adopting it was really straightforward as I had previous experiences with
Laravel, TailwindCSS and Svelte …