1.1.14 • Published 3 months ago

@emotionagency/utils v1.1.14

Weekly downloads
1
License
MIT
Repository
github
Last release
3 months ago

Useful utilities from the emotion-agency

Instalation

npm i @emotionagency/utils

or

yarn add @emotionagency/utils

Usage

Raf

Custom wrapper around standard API of requestAnimationFrame to optimize performance

import {raf} from '@emotionagency/utils'

\\ subscribe
raf.on(fn)

unsubscribe
raf.off(fn)

Resize

Custom wrapper around standard API of resize event with debounce function to optimize performance

import {resize} from '@emotionagency/utils'

\\ subscribe
resize.on(fn)

unsubscribe
resize.off(fn)

Lerp

Standart lerp function

import {lerp} from '@emotionagency/utils'

lerp(first number, second number, interpolation value)

Clamp

Standart clamp function

import {clamp} from '@emotionagency/utils'

clamp(clamping value, min value, max value)

CreateNewElement

A function that creates a new DOM-element with the ability to immediately assign the necessary classes to it

import {createNewElement} from '@emotionagency/utils'

createNewElement(tag, classes)

Delay

A function that creates a Promise with delay

import {delayPromise} from '@emotionagency/utils'

async delayFunc = () => {
  await delayPromise(1000)
  //logic
}

Keys Generator

A function that generate random string by length

import {keysGenerator} from '@emotionagency/utils'

const randomKey = keysGenerator(10)
1.1.12

3 months ago

1.1.11

3 months ago

1.1.14

3 months ago

1.1.13

3 months ago

1.1.9

5 months ago

1.1.8

5 months ago

1.1.7

5 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

10 months ago

1.1.10

5 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago

0.0.8

2 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago