@publishfx/publish-hooks
v1.1.1
Published
A collection of reusable React hooks for the Publish platform.
Readme
Publish Hooks Library
A collection of reusable React hooks for the Publish platform.
Overview
This package provides a set of custom React hooks designed to handle common functionality and logic needed across the Publish platform. These hooks encapsulate state management, side effects, and other cross-cutting concerns.
Setup
Install the dependencies:
pnpm installDevelopment
Build the library:
pnpm buildBuild the library in watch mode for development:
pnpm devAvailable Hooks
useAuth
A hook for handling authentication state and operations.
import { useAuth } from '@moonton/publish-hooks';
function MyComponent() {
const isAuth = useAuth(moduleAuthority, module,operation);
// Implementation details...
}Adding New Hooks
- Create your hook in the
srcdirectory - Export it in
src/index.ts - Document its usage in this README
Peer Dependencies
This package requires the following peer dependencies:
- react (>=18.3.1)
- react-dom (>=18.3.1)
