Socket
Socket
Sign inDemoInstall

iztro-hook

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iztro-hook

A hook of iztro。紫微斗数开源库iztro的react钩子函数。


Version published
Weekly downloads
7
decreased by-87.93%
Maintainers
1
Weekly downloads
 
Created
Source

📦 iztro-hook

紫微斗数开源库iztro的react钩子函数。

Maintainability Codecov npm Codecov npm GitHub GitHub code size in bytes Package Quality


基于 iztro 实现的 react hook。 用于获取紫微斗数星盘数据,运限数据(大小限,流年,流月,流日,流时等)。详细功能请查看 iztro开发文档

安装 (installation)

npm install iztro iztro-hook -S

你可以用任何你熟悉的包管理软件来安装依赖。

参数 (parameters)

export type IztroInput = {
  birthday: string;
  birthTime: number;
  gender: GenderName;
  birthdayType: 'lunar' | 'solar';
  isLeapMonth?: boolean;
  fixLeap?: boolean;
};

hook 定义 (hook defination)

type useIztro = (input: IztroInput) => {
  astrolabe: FunctionalAstrolabe | undefined;
  horoscope: Horoscope | undefined;
  setHoroscope: (date: string | Date, hour?: number) => void;
}

使用 (how to use?)

hook 只能在 react 组件中使用,如果你的项目不是使用 react 框架开发的,请使用 iztro 自行封装。


import React from 'react';
import { useIztro } from 'iztro-hook';

export default App() {
  const { astrolabe, horoscope, setHoroscope } = useIztro({
    birthday: '2000-18-16',
    birthdayType: 'solar',
    birthTime: 2,
    gender: '女',
    fixLeap: true,
  });


  return (
    <>在此绑定数据进行渲染</>
  );
}

如果你想了解更多关于紫微斗数的知识或者本开源库的信息,可以查看 iztro。如果好用记得给我一个⭐️鼓励哦~

Keywords

FAQs

Package last updated on 05 May 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