FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Stop writing the same filter boilerplate in every Inertia.js project
How-To

Stop writing the same filter boilerplate in every Inertia.js project

via Dev.toPaweł Targosinski2h ago

Every Laravel + Inertia app has a list page. Every list page has filters. And every time, you write the same thing: const search = ref ( '' ) const status = ref ( null ) const perPage = ref ( 15 ) watch ([ search , status , perPage ], debounce (() => { router . get ( ' /users ' , pickBy ({ search : search . value , status : status . value , perPage : perPage . value }), { preserveState : true , replace : true , }) }, 300 )) Then you realize pickBy doesn't handle false correctly. Then you add URL hydration on mount. Then you add a reset button. Then you need instant visits for perPage but debounced for search . Then you paste the whole thing into the next project. I got tired of this. So I extracted it into a composable and published it. Introducing useInertiaFilters npm install @mits_pl/use-inertia-filters The same page, now: < script setup lang= "ts" > import { useInertiaFilters } from ' @mits_pl/use-inertia-filters ' const { filters , reset , isDirty } = useInertiaFilters ({ search :

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles

I Regret to Inform You That You’re Using an Inferior Pour-Over Coffee Brewer
How-To

I Regret to Inform You That You’re Using an Inferior Pour-Over Coffee Brewer

Wired • 2h ago

How to Watch March Madness 2026
How-To

How to Watch March Madness 2026

Wired • 3h ago

Spring Cleaning? Here's How to Declutter Responsibly—and Maybe Earn Some Cash
How-To

Spring Cleaning? Here's How to Declutter Responsibly—and Maybe Earn Some Cash

Wired • 3h ago

Japan Approves the World’s First Treatment Made With Reprogrammed Human Cells
News

Japan Approves the World’s First Treatment Made With Reprogrammed Human Cells

Wired • 3h ago

I Tested Windsurf, Cursor, and Claude Code on the Same Project.
News

I Tested Windsurf, Cursor, and Claude Code on the Same Project.

Medium Programming • 3h ago

Discover More Articles