Frontend Developer | TS, react.js, next.js
-
Zoftify
- Tashkent, Uzbekistan
- @akbarjondev
- in/akbarjondev
Pinned Loading
-
Function returns an array of objects...
Function returns an array of objects which are used to fill white gaps which are created by Muuri (grid) package 1import Grid from 'muuri'
23interface GapFillerProps {
4height: number
5columnId: number
-
Hook for converting small images or ...
Hook for converting small images or thumbnails into binary data. Converting images in this way gives good experience while loading images in Next.js apps 1import { useEffect } from 'react'
23export function useImageToBase64(
4src: string,
5callback: (res: string) => void,
-
Get true (boolean value) when screen...
Get true (boolean value) when screen reaches given screen size 1import { useCallback, useState, useEffect } from 'react'
23export function useScreenSize(screenSize: number): boolean[] {
4const [isActive, setIsActive] = useState<boolean>(false)
5 -
Adds Event listeners to HTML element...
Adds Event listeners to HTML elements and safely removes them 1export function bind(target, { type, listerner, options }) {
2target.addEventListener(type, listerner, options);
34return function unbind() {
5target.removeEventListener(type, listerner, options);
-
Javascript generate fixed length ran...
Javascript generate fixed length random number function 1const getFixedLengthRandomnumber = fixed_digit => (String(Math.round(Math.random() * (10**fixed_digit))).padEnd(fixed_digit, '0') - 0)
23getFixedLengthRandomnumber(6)
-
A complete guide to check data types...
A complete guide to check data types in JavaScript 1function getType(obj) {
2const lowerCaseTheFirstLetter = (str) => str[0].toLowerCase() + str.slice(1);
3const type = typeof obj;
4if (type !== 'object') {
5return type;
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.