Skip to content

Commit 984fb00

Browse files
Merge pull request #8 from SamiurRahmanMukul/feature/library
library funcation documentaion write
2 parents 4a6163d + 295c12e commit 984fb00

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ npm i mukul-react-hooks
1515
3. [useIsTopOfPage - Hook 🚀](#3-useistopofpage)
1616
4. [useFullScreen - Hook 🚀](#4-usefullscreen)
1717
5. [useUnsavedChangeAlert - Hook 🚀](#5-useunsavedchangealert)
18+
6. [Library Functions 🚀](#collections-of-javascript-library-funcations)
1819

1920
### 1. useTimeout
2021

@@ -132,6 +133,63 @@ export default function MyComponents() {
132133
}
133134
```
134135

136+
## Collections of JavaScript Library Funcations
137+
138+
```js
139+
"use client";
140+
141+
import { lib } from "mukul-react-hooks";
142+
143+
const {
144+
arrayToCommaSeparatedText,
145+
asyncDelay,
146+
downloadString,
147+
internationalCurrencyConvert,
148+
isEmptyObject,
149+
isValidEmail,
150+
numberFormatWithCommas,
151+
randomColor,
152+
transformString,
153+
truncateStringEnd,
154+
truncateStringMiddle,
155+
unixToDateTime,
156+
waitSomeMoment,
157+
} = lib;
158+
159+
export default async function MyComponents() {
160+
console.log(arrayToCommaSeparatedText(["a", "b", "c"])); // a, b, c
161+
console.log(internationalCurrencyConvert(1000000)); // 1 M
162+
console.log(isEmptyObject({})); // true
163+
console.log(isValidEmail("example@mail.com")); // true
164+
console.log(numberFormatWithCommas(1000000)); // 1,000,000
165+
console.log(randomColor()); // #ff0000 --> generated random color in hex format
166+
console.log(transformString("My Name Is Mukul")); // my_name_is_mukul
167+
console.log(truncateStringEnd("My Name Is Mukul", 10)); // My Name Is...
168+
console.log(truncateStringMiddle("My Name Is Mukul", 10, "...")); // My ...ukul
169+
console.log(unixToDateTime(1668300000)); // 20 Jan 1970, 1:25 PM
170+
171+
// Asynchronous Components or JavaScript functions delay
172+
asyncDelay(3000); // define time with milliseconds
173+
174+
// Any functions inner code next line exexution delay
175+
function example() {
176+
console.log("exuction start");
177+
waitSomeMoment(3000); // define time with milliseconds
178+
console.log("delay exexution after 3000 milliseconds");
179+
}
180+
181+
return (
182+
<div>
183+
{/* download any string with your prefarable extention:
184+
--> 1st parameter recived your string,
185+
--> 2nd parameter recived file name and
186+
--> 3rd parameter recived file extention */}
187+
<button onClick={() => downloadString("My Name Is Mukul", "mukul", "txt")}>Download</button>
188+
</div>
189+
);
190+
}
191+
```
192+
135193
<p align="center">
136194
HAPPY DEVELOPMENT 😄😊🙂
137195
</p>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mukul-react-hooks",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"type": "module",
55
"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'.",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)