Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@soubai/use-wikipedia

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soubai/use-wikipedia

A simple react hook for query wikipedia API

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

🧰 useWikipedia: React Hook for query wikipedia API

All Contributors

A hook to help you to query a wikipedia search API

install

yarn add @soubai/use-wikipedia

Usage

import useWikipedia from "@soubai/use-wikipedia";

function MyComponent() {
  const { data, error } = useDocumentTitle("Morocco");
  return <div />;
}
  • OR
import useWikipedia from "@soubai/use-wikipedia";
const [error, setError] = useState(null);
const [data, setData] = useState([]);
const [q, setQ] = useState("");
const { query } = useWikipedia();

const search = async () => {
  // query take search string and limit result per page (default 10)
  const { data, error } = await query(q, 10);
  setData(data);
  setError(error);
};

Example

for more detail about use see ./example/

Keywords

FAQs

Package last updated on 17 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc