Skip to content

Commit a738c16

Browse files
committed
feat: add random number generator
1 parent d8b2842 commit a738c16

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

dev/components/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22

33
import Typist from '../../src';
4+
import randomDelayGenerator from '../utils/randomDelayGenerator';
45

56
export default function Header() {
67
return (

dev/utils/randomDelayGenerator.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function randomDelayGenerator(base = 75, bias = 20) {
2+
return base + (Math.random() - 0.5) * bias;
3+
}

0 commit comments

Comments
 (0)