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

use-context-selector

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-context-selector - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

dist/index.modern.js

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Change Log

## [1.1.2] - 2020-07-02
### Changed
- Modern build
## [1.1.1] - 2020-03-02

@@ -7,0 +11,0 @@ ### Changed

2

dist/index.umd.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).useContextSelector={},e.react)}(this,function(e,t){t=t&&t.hasOwnProperty("default")?t.default:t;var n="production"!==process.env.NODE_ENV?Symbol("CONTEXT_LISTENERS"):Symbol(),r=function(e,r){var o=e[n];if("production"!==process.env.NODE_ENV&&!o)throw new Error("useContextSelector requires special context");var u=t.useReducer(function(e){return e+1},0)[1],c=t.useContext(e),f=r(c),i=t.useRef(null);return t.useLayoutEffect(function(){i.current={f:r,v:c,s:f}}),t.useLayoutEffect(function(){var e=function(e){try{if(i.current.v===e||Object.is(i.current.s,i.current.f(e)))return}catch(e){}u()};return o.add(e),function(){o.delete(e)}},[o]),f};e.createContext=function(e){var r,o,u=t.createContext(e,function(){return 0});return u[n]=new Set,u.Provider=(r=u.Provider,o=u[n],t.memo(function(e){var n=e.value,u=e.children;return"production"!==process.env.NODE_ENV?t.useLayoutEffect(function(){o.forEach(function(e){e(n)})}):o.forEach(function(e){e(n)}),t.createElement(r,{value:n},u)})),delete u.Consumer,u},e.useContext=function(e){return r(e,function(e){return e})},e.useContextSelector=r});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).useContextSelector={},e.react)}(this,function(e,t){t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var n="production"!==process.env.NODE_ENV?Symbol("CONTEXT_LISTENERS"):Symbol(),r=function(e,r){var o=e[n];if("production"!==process.env.NODE_ENV&&!o)throw new Error("useContextSelector requires special context");var u=t.useReducer(function(e){return e+1},0)[1],c=t.useContext(e),f=r(c),i=t.useRef(null);return t.useLayoutEffect(function(){i.current={f:r,v:c,s:f}}),t.useLayoutEffect(function(){var e=function(e){try{if(i.current.v===e||Object.is(i.current.s,i.current.f(e)))return}catch(e){}u()};return o.add(e),function(){o.delete(e)}},[o]),f};e.createContext=function(e){var r,o,u=t.createContext(e,function(){return 0});return u[n]=new Set,u.Provider=(r=u.Provider,o=u[n],t.memo(function(e){var n=e.value,u=e.children;return"production"!==process.env.NODE_ENV?t.useLayoutEffect(function(){o.forEach(function(e){e(n)})}):o.forEach(function(e){e(n)}),t.createElement(r,{value:n},u)})),delete u.Consumer,u},e.useContext=function(e){return r(e,function(e){return e})},e.useContextSelector=r});
//# sourceMappingURL=index.umd.js.map
{
"name": "use-context-selector",
"description": "React useContextSelector hook in userland",
"version": "1.1.1",
"version": "1.1.2",
"author": "Daishi Kato",

@@ -10,7 +10,7 @@ "repository": {

},
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"browser": "./dist/index.umd.js",
"source": "./src/index.js",
"main": "./dist/index.umd.js",
"module": "./dist/index.modern.js",
"types": "./src/index.d.ts",
"sideEffects": false,
"files": [

@@ -21,3 +21,3 @@ "src",

"scripts": {
"compile": "microbundle build --format cjs,es,umd",
"compile": "microbundle build -f modern,umd",
"test": "run-s eslint tsc-test jest",

@@ -39,30 +39,30 @@ "eslint": "eslint --ext .js,.ts,.tsx --ignore-pattern dist .",

"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"@testing-library/react": "^9.4.1",
"@types/react": "^16.9.22",
"@types/react-dom": "^16.9.5",
"@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/parser": "^2.20.0",
"babel-loader": "^8.0.6",
"documentation": "^12.1.4",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-react-hooks": "^2.4.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^25.1.0",
"microbundle": "^0.12.0-next.8",
"@babel/cli": "^7.10.4",
"@babel/core": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"@testing-library/react": "^10.4.3",
"@types/react": "^16.9.41",
"@types/react-dom": "^16.9.8",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"babel-loader": "^8.1.0",
"documentation": "^13.0.2",
"eslint": "^7.3.1",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.5",
"html-webpack-plugin": "^4.3.0",
"jest": "^26.1.0",
"microbundle": "^0.12.2",
"npm-run-all": "^4.1.5",
"react": "experimental",
"react-dom": "experimental",
"ts-loader": "^6.2.1",
"typescript": "^3.8.2",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
"ts-loader": "^7.0.5",
"typescript": "^3.9.6",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},

@@ -69,0 +69,0 @@ "peerDependencies": {

# use-context-selector
[![Build Status](https://travis-ci.com/dai-shi/use-context-selector.svg?branch=master)](https://travis-ci.com/dai-shi/use-context-selector)
[![npm version](https://badge.fury.io/js/use-context-selector.svg)](https://badge.fury.io/js/use-context-selector)
[![bundle size](https://badgen.net/bundlephobia/minzip/use-context-selector)](https://bundlephobia.com/result?p=use-context-selector)
[![CI](https://img.shields.io/github/workflow/status/dai-shi/use-context-selector/CI)](https://github.com/dai-shi/use-context-selector/actions?query=workflow%3ACI)
[![npm](https://img.shields.io/npm/v/use-context-selector)](https://www.npmjs.com/package/use-context-selector)
[![size](https://img.shields.io/bundlephobia/minzip/use-context-selector)](https://bundlephobia.com/result?p=use-context-selector)

@@ -7,0 +7,0 @@ React useContextSelector hook in userland

Sorry, the diff of this file is not supported yet

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