Skip to content

mlfcnt/qs-filter

Repository files navigation

qs-filter

hook to filter items from query parameters

NPM JavaScript Style Guide

Install

npm install --save qs-filter

Usage

import React from 'react'
import { useFilterFromQueryParams } from 'qs-filter'

const App = () => {
  const users: User[] = [
    {
      id: 1,
      isActive: true,
      isFinalized: false
    },
    {
      id: 2,
      isActive: false,
      isFinalized: true
    }
  ]
  const filteredUsers = useFilterFromQueryParams(users)
  return filteredUsers.map((user) => (
    <>
      <p>Id : {user.id}</p>
      <p>isActive : {user.isActive.toString()}</p>
      <p>isFinalized : {user.isFinalized.toString()}</p>
    </>
  ))
}

License

MIT © mlfcnt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published