Skip to content

crazy-thursday/useKFC

Repository files navigation

kfc logo

English | Chinese


npm package node compatibility build status discord chat


useKFC

make kfc slogen for crazy thursday!!!

Usage

  • hooks 🌩
import useKFC, { useParseSlogen } from '@crazy-thursday/use-kfc'
// if u not have exists slogenList, use package json
import slogenLike from '@crazy-thursday/use-kfc/slogen'

/**
 * @description slogen item struct
 */
export type SlogenItem = {
  /**
   * @description slogen content message
   */
  content: string
  /**
   * @description slogen id to avoid repeat
   */
  id: string | number
}

export type Options<T> = {
  /**
   * @description is provide, slogen will random from this array
   */
  slogenList: SlogenItem[]
  /**
   * @description manual refresh slogen
   */
  refreshSignal?: T
  /**
   * @description whether skip thursday check
   */
  skipDayCheck?: boolean
}

function App() {
  const slogenList = useParseSlogen(slogenLike)
  const { slogen } = useKFC({
    slogenList
  })

  return {
    <pre>{slogen}</pre>
  }
}
  • api 💻
$ curl 'https://use-kfc-serve.deno.dev/kfc'
  • data struct 📚
export enum CODE {
  /**
   * @description success code
   */
  SUCCESS = 10086,
  /**
   * @description failed code
   */
  FAILED = 10087,
  /**
   * @description deny code
   */
  DENY = 10089
}

type DataStruct = {
  code: CODE
  ip: string
  method: 'GET'
  data: {
    content: string
    id: string
    createUser: string
  }
}

Slogen

The repository has some slogen built in. You can also use issues to contribute to slogen. But please make sure that the issue contains complete and non-controversial text or emoticons. Add the slogen tag after you finish editing the content. Github CI will automatically collect your contributions to the repository.

Contribution

See Contributing Guide.

License

MIT.

Sponsoring