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

@zhajizhaji/meteo-hooks

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zhajizhaji/meteo-hooks

This library was generated with [Nx](https://nx.dev).

  • 0.0.20
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

meteo-hooks

This library was generated with Nx.

生成文档

全局安装以下两个包吧,方便点 npm install -g typedoc serve

  typedoc --tsconfig tsconfig-doc.json
  serve docs

使用方式

  1. 先设置代理和token ,要求能访问到接口
  2. 使用 useStationInfos 获取站点信息,用以拼合数据
  3. React 环境下使用这个,比如 Nextjs , 注意安装peer依赖
import { DemoPage, setMeteoConfig, useStationInfos } from "@zhajizhaji/meteo-hooks";
import { useEffect } from 'react'

setMeteoConfig({
  host: "https://sszc.sentinels.site",
  sign:"http://shuzicang.sentinels.site/api/public/sign",
  gm:"http://shuzicang.sentinels.site/api/public/gm",
  key:cookie.get("key")
})

const adminCodes = ["330000"];

export default function Meteo() {
  const { data, loading, fetchData } = useStationInfos();

  // 使用 onInitialize 钩子,在组件初始化时触发加载数据
  useEffect(() => {
    if (data === null && !loading) {
      fetchData(adminCodes);
    }
  }, [loading, data, fetchData]);
  return <div className="">
    <DemoPage />
  </div>
}

FAQs

Package last updated on 20 Apr 2024

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