Skip to content

Commit

Permalink
Merge pull request #8 from SamiurRahmanMukul/feature/library
Browse files Browse the repository at this point in the history
library funcation documentaion write
  • Loading branch information
SamiurRahmanMukul authored Mar 16, 2024
2 parents 4a6163d + 295c12e commit 984fb00
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ npm i mukul-react-hooks
3. [useIsTopOfPage - Hook 🚀](#3-useistopofpage)
4. [useFullScreen - Hook 🚀](#4-usefullscreen)
5. [useUnsavedChangeAlert - Hook 🚀](#5-useunsavedchangealert)
6. [Library Functions 🚀](#collections-of-javascript-library-funcations)

### 1. useTimeout

Expand Down Expand Up @@ -132,6 +133,63 @@ export default function MyComponents() {
}
```

## Collections of JavaScript Library Funcations

```js
"use client";

import { lib } from "mukul-react-hooks";

const {
arrayToCommaSeparatedText,
asyncDelay,
downloadString,
internationalCurrencyConvert,
isEmptyObject,
isValidEmail,
numberFormatWithCommas,
randomColor,
transformString,
truncateStringEnd,
truncateStringMiddle,
unixToDateTime,
waitSomeMoment,
} = lib;

export default async function MyComponents() {
console.log(arrayToCommaSeparatedText(["a", "b", "c"])); // a, b, c
console.log(internationalCurrencyConvert(1000000)); // 1 M
console.log(isEmptyObject({})); // true
console.log(isValidEmail("[email protected]")); // true
console.log(numberFormatWithCommas(1000000)); // 1,000,000
console.log(randomColor()); // #ff0000 --> generated random color in hex format
console.log(transformString("My Name Is Mukul")); // my_name_is_mukul
console.log(truncateStringEnd("My Name Is Mukul", 10)); // My Name Is...
console.log(truncateStringMiddle("My Name Is Mukul", 10, "...")); // My ...ukul
console.log(unixToDateTime(1668300000)); // 20 Jan 1970, 1:25 PM

// Asynchronous Components or JavaScript functions delay
asyncDelay(3000); // define time with milliseconds

// Any functions inner code next line exexution delay
function example() {
console.log("exuction start");
waitSomeMoment(3000); // define time with milliseconds
console.log("delay exexution after 3000 milliseconds");
}

return (
<div>
{/* download any string with your prefarable extention:
--> 1st parameter recived your string,
--> 2nd parameter recived file name and
--> 3rd parameter recived file extention */}
<button onClick={() => downloadString("My Name Is Mukul", "mukul", "txt")}>Download</button>
</div>
);
}
```

<p align="center">
HAPPY DEVELOPMENT 😄😊🙂
</p>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mukul-react-hooks",
"version": "1.1.0",
"version": "1.1.1",
"type": "module",
"description": "Introducing the 'mukul-react-hooks' NPM package, designed to streamline complex problem-solving within React web applications. Our custom hooks services offer an effortless solution for efficiently addressing intricate challenges. Experience seamless integration and enhanced functionality with 'mukul-react-hooks'.",
"main": "dist/index.js",
Expand Down

0 comments on commit 984fb00

Please sign in to comment.