JSPM

use-search-hook

0.2.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q18288F
  • License ISC

utilize this to quickly manipulate the search section of your url. Navigation may be enabled, but it not assumed. While built to be a react hook, it can be used in any style of Javascript application

Package Exports

  • use-search-hook
  • use-search-hook/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-search-hook) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

use-search-hook

This module allows you to manipulate your url search string on the fly without effort, with optional navigation in response to changes.

Getting Started

To install, in terminal type

    npm i --save use-search-hook

then, in your react project, or in any other module context

import useSearch from 'use-search-hook';

and finally, implement it by including that component within your code:

const search = useSeach<yourObjectStyle>(yourDefaultObject)
search.key = value

this would result in your url changing from yoursite.com/apath to yoursite.com/apath?key=value

search({a: "change", to: "search"})

this would result in your url changing from yoursite.com/apath to yoursite.com/apath?a=change&to=search