Socket
Book a DemoInstallSign in
Socket

react-typewriter-hook

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-typewriter-hook - npm Package Compare versions

Comparing version

to
1.0.2

8

build/useTypewriter.js

@@ -5,3 +5,2 @@ "use strict";

var typeWriter_1 = require("./typeWriter");
var writter = new typeWriter_1.default();
function useTypeWritter(str) {

@@ -11,9 +10,10 @@ var _a = react_1.useState(null), word = _a[0], setWord = _a[1];

var strRef = react_1.useRef({});
var writerInstRef = react_1.useRef(new typeWriter_1.default());
react_1.useEffect(function () {
strRef.current = setWord(writter.startTypeWord(str));
strRef.current = setWord(writerInstRef.current.startTypeWord(str));
}, [str]);
react_1.useEffect(function () {
intervalRef.current = setInterval(function () {
setWord(writter.typing());
}, writter.rd());
setWord(writerInstRef.current.typing());
}, writerInstRef.current.rd());
return function clear() {

@@ -20,0 +20,0 @@ clearInterval(intervalRef.current);

{
"name": "react-typewriter-hook",
"version": "1.0.1",
"version": "1.0.2",
"description": "⌨️ Use react hooks for typing effect easily",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.