v_core_react_toolkit
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

v_core_react_toolkit

============================

⚠ [ALPHA ver.] Warning [ALPHA ver.] ⚠

============================

a package that gives you custom React things

NPM JavaScript Style Guide

Install

npm install --save v_core_react_toolkit

Usage

import {
  components, //? React Components
  hooks, //? React Hooks
  creators, //? Creator Functions Array
  utils
} from 'v_core_react_toolkit'

const {
  LogoV9,
  Section,
  HCC_PreviewSection,
  demoExamples  // Array of Example Components
} = components

const {
  CounterHookExample,
  HoverHookExample,
  MountedHookExample,
  OnlineStatusHookExample,
  TogglerHookExample,
  LocalStorageHookExample,
  WindowSizeHookExample,
  ContextWithProviderExample
} = demoExamples  

const {
  useCounter,
  useDocumentTitle,
  useHover,
  useIsMounted,
  useToggler,
  useWindowSize,
  useOnlineStatus,
  useLocalStorage,
  useMousePosition,
  useRelativeMousePosition,
  useNetworkState,
  useThrottledFunction
} = hooks

const {
  createContextAndHook
} = creators


const { 
  canUseDOM,
  throttle
} = utils
// Your Custom Code...

Hooks

  1. useCounter
import React from 'react'

import { hooks: { useCounter } } from 'v_core_react_toolkit'

const App = () => {
  const { count, setCount, increment, decrement, reset } = useCounter(4)

  useDocumentTitle(count)

  return (
    <div>
      <V9Logo height='240px' width='120px' />
      
      <p>Count: {count}</p>
      <button onClick={() => increment()}>increment</button>
      <button onClick={() => decrement()}>decrement</button>
      <button onClick={() => setCount(count + 5)}>Add 5</button>
      <button onClick={() => setCount(count - 5)}>Subtract 5</button>
      <button onClick={() => reset()}>reset</button>
    </div>
  )
}
  1. useDocumentTitle
  1. useHover
  1. useIsMounted
  1. useLocalStorage
  1. useMousePosition
  1. useNetworkState
  1. useOnlineStatus
  1. useRelativeMousePosition
  1. useToggler
  1. useWindowSize
  1. useThrottledFunction

Components

Creators

  1. createContextAndHook
  1. createContextSliceReducerHook

Utils

  1. canUseDOM
  1. throttle
  1. logGroupCollapsed
  1. classNames
  1. loop

License

MIT © V-core9

Readme

Keywords

none

Package Sidebar

Install

npm i v_core_react_toolkit

Weekly Downloads

0

Version

0.1.5

License

MIT

Unpacked Size

149 kB

Total Files

158

Last publish

Collaborators

  • v-core9