1.4.2 • Published 6 days ago

kanca v1.4.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 days ago

Kanca is custom React Hooks library.

Build Status npm Coveralls github CodeFactor Package Quality npm bundle size npm NPM JavaScript Style Guide

☕️ Features

  • Small and lightweight
  • Easy to learn
  • Functional approach
  • Fully written in Typescript

🕺 Install

by using npm:

$ npm i kanca

by using yarn:

$ yarn add kanca

kanca uses env-cmd as peerDependency. Make sure to install it if you want to environment variables in http hooks like useFetch.

If you don't know how to install it, just follow below section

yarn add env-cmd

Therefore just create files in root-dir which named

  • .env.development and
  • .env.production

and modify as listed below.

.env.development

REACT_APP_API=http://localhost:8080

.env.production

REACT_APP_API=https://api.myawesomewebservice.com

After creating files make sure to hide those files in .gitignore. They might include our credentials etc.

You could set various environment variables that needs in your application in those files like .env.development or .env.production.

Then: modify your package.json'scripts' like listed below

"scripts": {
    "start": "env-cmd -f ./.env.development react-scripts start",
    "build": "env-cmd -f ./.env.production react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

If you're ok until here, we can continue

You could import kanca in two ways

  • kanca
  • kanca/subpackage-name

What do I mean?

kanca has several subpackages. For example:

  • http
  • form
  • util ( not implemented yet )

That's exactly why both imports are valid.

import { useFetch } from "kanca";

or

import { useFetch } from "kanca/http";

Before using any hook, you should read its documentation!

🎨 Hooks

Made with

License

MIT © enesusta

1.4.2

6 days ago

1.4.1

7 days ago

1.4.0

7 days ago

1.3.9

2 months ago

1.3.8

2 months ago

1.3.7

10 months ago

1.3.6

11 months ago

1.3.5

11 months ago

1.3.4

11 months ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.9

1 year ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago