PHPnews.io

Overview for 'sebastiandedeyne'


The window.matchMedia API

Written by Sebastian De Deyne / Original link on Apr. 5, 2021

To execute a piece of code when the viewport is a certain size, the first thing that comes to mind is adding a resize event listener to the window object. This is one way, but not always the best. Sometimes the lesser known window.matchMedia API is a better fit. This is the well-known way to trigge…



The Record type in TypeScript

Written by Sebastian De Deyne / Original link on Mar. 31, 2021

I can’t count the amount of times I’ve defined an object type with unknown string keys and a specific value type. type Scores = { [key: string]: number; } And despite using it all the time, I can’t for the life of me remember the [key: string] syntax. Today, my problems are solved. Apparently TypeS…



Vite with Laravel: Using Inertia.js

Written by Sebastian De Deyne / Original link on Mar. 29, 2021

Time for the last—and my favorite—post in the Vite series: using Inertia.js. Inertia suggests two ways to resolve views in the docs: with require or with import. require bundles all your pages in a single file, it’s a Webpack-specific implementation import code splits your pages to multiple chunks,…