Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
iztro-hook
Advanced tools
紫微斗数开源库iztro的react钩子函数。
基于 iztro
实现的 react hook
。
用于获取紫微斗数星盘数据,运限数据(大小限,流年,流月,流日,流时等)。详细功能请查看 iztro开发文档
npm install iztro iztro-hook -S
你可以用任何你熟悉的包管理软件来安装依赖。
export type IztroInput = {
birthday: string;
birthTime: number;
gender: GenderName;
birthdayType: 'lunar' | 'solar';
isLeapMonth?: boolean;
fixLeap?: boolean;
};
GenderName
的定义在 iztro 开发文档 -> GenderName 里。type useIztro = (input: IztroInput) => {
astrolabe: FunctionalAstrolabe | undefined;
horoscope: Horoscope | undefined;
setHoroscope: (date: string | Date, hour?: number) => void;
}
FunctionalAstrolabe
的定义在 iztro 开发文档 -> FunctionalAstrolabe 里。Horoscope
的定义在 iztro 开发文档 -> Horoscope 里。该 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。如果好用记得给我一个⭐️鼓励哦~
FAQs
A hook of iztro。紫微斗数开源库iztro的react钩子函数。
The npm package iztro-hook receives a total of 3 weekly downloads. As such, iztro-hook popularity was classified as not popular.
We found that iztro-hook demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.