New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@schibstedspain/sui-react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@schibstedspain/sui-react-hooks - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

10

CHANGELOG.md

@@ -5,1 +5,11 @@ # Change Log

<a name="1.2.0"></a>
# 1.2.0 (2019-06-25)
### Features
* adaptation to be able to execute asynchronous functions ([70b94a1](https://github.com/SUI-Components/schibsted-spain-components/commit/70b94a1))

4

lib/useMount/index.js
import { useEffect } from 'react';
export default function useMount(effect) {
useEffect(effect, []); // eslint-disable-line
useEffect(function () {
return effect();
}, []); // eslint-disable-line
}

@@ -0,1 +1,2 @@

import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import { useEffect, useRef, useState } from 'react';

@@ -23,4 +24,5 @@ import PropTypes from 'prop-types';

var _useState = useState(false),
isIntersecting = _useState[0],
setIntersecting = _useState[1];
_useState2 = _slicedToArray(_useState, 2),
isIntersecting = _useState2[0],
setIntersecting = _useState2[1];

@@ -38,3 +40,5 @@ var outerRef = useRef();

observer = new window.IntersectionObserver(function (_ref4) {
var entry = _ref4[0];
var _ref5 = _slicedToArray(_ref4, 1),
entry = _ref5[0];
// Update our state when observer callback fires

@@ -41,0 +45,0 @@ setIntersecting(entry.isIntersecting);

{
"name": "@schibstedspain/sui-react-hooks",
"version": "1.1.0",
"version": "1.2.0",
"description": "",

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

@@ -31,3 +31,10 @@ # ReactHooks

return <h1>Hey!</h1>
const [currentUser, setCurrentUser] = useState(null)
useMount(async () => {
const user = await getUser()
setCurrentUser(user)
})
return currentUser && <h1>Hello {currentUser.name} !!</h1>
}

@@ -34,0 +41,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc