Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@frontity/hooks

Package Overview
Dependencies
Maintainers
6
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frontity/hooks - npm Package Compare versions

Comparing version 1.1.14 to 1.2.0

use-in-view.test.tsx

71

CHANGELOG.md
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 1.2.0
## [1.1.14](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.13...@frontity/hooks@1.1.14) (2019-12-10)
### Minor Changes
**Note:** Version bump only for package @frontity/hooks
- [`1aa1fb22`](https://github.com/frontity/frontity/commit/1aa1fb22e4da9f0c8b00dd08cb364eea31f20a6c) [#256](https://github.com/frontity/frontity/pull/256) Thanks [@michalczaplinski](https://github.com/michalczaplinski)! - Deprecate the @frontity/hooks package and recommend https://github.com/thebuilder/react-intersection-observer instead.
### Patch Changes
- [`b9372580`](https://github.com/frontity/frontity/commit/b937258068c13e97265d96a6239d584673a17fcd) [#251](https://github.com/frontity/frontity/pull/251) Thanks [@michalczaplinski](https://github.com/michalczaplinski)! - Bugfix for useInView hook. Fixes occasional error when attempting to find a nonexistent element in page.
- Updated dependencies [[`417f2b0f`](https://github.com/frontity/frontity/commit/417f2b0f0b6f5626be253eb3f1be2daf257b71ef), [`495771f8`](https://github.com/frontity/frontity/commit/495771f83951f192f92d3162221cedc9b791e399), [`80c1aa3a`](https://github.com/frontity/frontity/commit/80c1aa3aee6cf04f46d6fa1a409abfcae2c511cc)]:
- frontity@1.5.0
## [1.1.14](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.13...@frontity/hooks@1.1.14) (2019-12-10)
**Note:** Version bump only for package @frontity/hooks

@@ -18,6 +23,2 @@ ## [1.1.13](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.12...@frontity/hooks@1.1.13) (2019-11-04)

## [1.1.12](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.11...@frontity/hooks@1.1.12) (2019-10-10)

@@ -27,17 +28,8 @@

## [1.1.11](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.10...@frontity/hooks@1.1.11) (2019-10-02)
### Bug Fixes
* **typescript:** update to latest version ([a89b11c](https://github.com/frontity/frontity/commit/a89b11c))
- **typescript:** update to latest version ([a89b11c](https://github.com/frontity/frontity/commit/a89b11c))
## [1.1.10](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.9...@frontity/hooks@1.1.10) (2019-09-10)

@@ -47,6 +39,2 @@

## [1.1.9](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.8...@frontity/hooks@1.1.9) (2019-08-12)

@@ -56,6 +44,2 @@

## [1.1.8](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.7...@frontity/hooks@1.1.8) (2019-07-12)

@@ -65,6 +49,2 @@

## [1.1.7](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.6...@frontity/hooks@1.1.7) (2019-07-04)

@@ -74,6 +54,2 @@

## [1.1.6](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.5...@frontity/hooks@1.1.6) (2019-07-04)

@@ -83,6 +59,2 @@

## [1.1.5](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.4...@frontity/hooks@1.1.5) (2019-07-01)

@@ -92,6 +64,2 @@

## [1.1.4](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.3...@frontity/hooks@1.1.4) (2019-06-20)

@@ -101,6 +69,2 @@

## [1.1.3](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.2...@frontity/hooks@1.1.3) (2019-06-20)

@@ -110,6 +74,2 @@

## [1.1.2](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.1...@frontity/hooks@1.1.2) (2019-06-20)

@@ -119,6 +79,2 @@

## [1.1.1](https://github.com/frontity/frontity/compare/@frontity/hooks@1.1.0...@frontity/hooks@1.1.1) (2019-06-19)

@@ -128,11 +84,6 @@

# 1.1.0 (2019-06-19)
### Features
* **packages:** creates packages @frontity/components, @frontity/hooks, and adds image processor to @frontity/html2react ([#130](https://github.com/frontity/frontity/issues/130)) ([6af4aa1](https://github.com/frontity/frontity/commit/6af4aa1))
- **packages:** creates packages @frontity/components, @frontity/hooks, and adds image processor to @frontity/html2react ([#130](https://github.com/frontity/frontity/issues/130)) ([6af4aa1](https://github.com/frontity/frontity/commit/6af4aa1))

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

module.exports = {
transform: { "^.+\\.(t|j)sx?$": "ts-jest" },
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
testPathIgnorePatterns: ["/mocks/"]
};
const rootConfig = require("../../jest.config.js");
module.exports = rootConfig;
{
"name": "@frontity/hooks",
"version": "1.1.14",
"version": "1.2.0",
"description": "Collection of React hooks for »Frontity",

@@ -18,4 +18,4 @@ "keywords": [

"scripts": {
"test:ci": "jest --passWithNoTests",
"test": "jest --watch",
"test:ci": "../../node_modules/.bin/jest --passWithNoTests",
"test": "../../node_modules/.bin/jest --watch",
"test:inspect": "node --inspect ./node_modules/jest/bin/jest.js --watch --no-cache --runInBand"

@@ -27,8 +27,4 @@ },

"devDependencies": {
"frontity": "^1.4.3",
"jest": "^24.7.1",
"ts-jest": "^24.0.2",
"typescript": "^3.6.3"
},
"gitHead": "d3fc3c17ae540bfe366f845c03ca1542c99b7189"
"frontity": "^1.5.0"
}
}
import { useState, useEffect, useRef, Dispatch, SetStateAction } from "react";
import { warn } from "frontity";

@@ -22,3 +23,3 @@ interface IntersectionObserverCallback {

// one to each entry on the IntersectionObserver callback.
let setFunctions: [
const setFunctions: [
Dispatch<SetStateAction<boolean>>,

@@ -34,3 +35,3 @@ React.MutableRefObject<undefined>

// `setIntersected` function for each changed entry.
let createCallback: IntersectionObserverCallbackCreator = options => {
const createCallback: IntersectionObserverCallbackCreator = options => {
return entries => {

@@ -42,4 +43,7 @@ entries.forEach(entry => {

// This is the `setIntersected` function.
setFunction[0](entry.isIntersecting);
// Check if we found the ref
if (setFunction) {
// This is the `setIntersected` function.
setFunction[0](entry.isIntersecting);
}

@@ -58,2 +62,8 @@ if (entry.isIntersecting && options.onlyOnce) {

useEffect(() => {
warn(
"The @frontity/hooks package is deprecated and will be removed in the future version of frontity.\nThe Frontity team recommends that you use https://github.com/thebuilder/react-intersection-observer instead."
);
}, []);
if (!observer)

@@ -60,0 +70,0 @@ observer = new IntersectionObserver(createCallback({ onlyOnce }), {

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