use-descendants
Advanced tools
Comparing version 1.0.0-beta.7 to 1.0.0-beta.8
@@ -1,1 +0,1 @@ | ||
function e(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var r=e(require("react")),t=function(){},n="undefined"==typeof window?t:r.useLayoutEffect,u=r.createContext({get:t,reset:t,map:{}});exports.Descendants=function(e){return e.value.reset(),r.createElement(u.Provider,{value:e.value},e.children)},exports.useDescendant=function(e){var t=r.useContext(u),c=r.useRef();c.current||(c.current=Math.random().toString(36).substr(2,9));var o=r.useState(-1),a=o[0],s=o[1];return n(function(){s(null==t?void 0:t.get(c.current,e))}),a},exports.useDescendants=function(){var e=r.useRef(0),t=r.useRef();return t.current||(t.current={}),{get:function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current[r].index},map:t,reset:function(){e.current=0,t.current={}}}}; | ||
function e(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var r=e(require("react")),t=r.createContext({}),n="undefined"==typeof window?function(){}:r.useLayoutEffect;exports.Descendants=function(e){return e.value.reset(),r.createElement(t.Provider,{value:e.value},e.children)},exports.useDescendant=function(e){var u=r.useContext(t),c=r.useRef();c.current||(c.current=Math.random().toString(36).substr(2,9));var o=r.useState(-1),a=o[0],i=o[1];return n(function(){i(null==u?void 0:u.get(c.current,e))}),a},exports.useDescendants=function(){var e=r.useRef(0),t=r.useRef();return t.current||(t.current={}),{get:function(r,n){return t.current[r]||(t.current[r]={index:n&&n.hidden?-1:e.current++}),t.current[r].props=n,t.current[r].index},map:t,reset:function(){e.current=0,t.current={}}}}; |
@@ -1,1 +0,1 @@ | ||
import*as e from"react";var r=function(){},t="undefined"==typeof window?r:e.useLayoutEffect,n=e.createContext({get:r,reset:r,map:{}}),u=function(r){return r.value.reset(),e.createElement(n.Provider,{value:r.value},r.children)},c=function(){var r=e.useRef(0),t=e.useRef();return t.current||(t.current={}),{get:function(e,n){return t.current[e]||(t.current[e]={index:r.current++}),t.current[e].props=n,t.current[e].index},map:t,reset:function(){r.current=0,t.current={}}}};function o(r){var u=e.useContext(n),c=e.useRef();c.current||(c.current=Math.random().toString(36).substr(2,9));var o=e.useState(-1),a=o[0],i=o[1];return t(function(){i(null==u?void 0:u.get(c.current,r))}),a}export{u as Descendants,o as useDescendant,c as useDescendants}; | ||
import*as e from"react";var r=e.createContext({}),t="undefined"==typeof window?function(){}:e.useLayoutEffect,n=function(t){return t.value.reset(),e.createElement(r.Provider,{value:t.value},t.children)},u=function(){var r=e.useRef(0),t=e.useRef();return t.current||(t.current={}),{get:function(e,n){return t.current[e]||(t.current[e]={index:n&&n.hidden?-1:r.current++}),t.current[e].props=n,t.current[e].index},map:t,reset:function(){r.current=0,t.current={}}}};function c(n){var u=e.useContext(r),c=e.useRef();c.current||(c.current=Math.random().toString(36).substr(2,9));var o=e.useState(-1),i=o[0],a=o[1];return t(function(){a(null==u?void 0:u.get(c.current,n))}),i}export{n as Descendants,c as useDescendant,u as useDescendants}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).useDescendants={},e.react)}(this,function(e,t){function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var r=n(t),u=function(){},c="undefined"==typeof window?u:r.useLayoutEffect,o=r.createContext({get:u,reset:u,map:{}});e.Descendants=function(e){return e.value.reset(),r.createElement(o.Provider,{value:e.value},e.children)},e.useDescendant=function(e){var t=r.useContext(o),n=r.useRef();n.current||(n.current=Math.random().toString(36).substr(2,9));var u=r.useState(-1),f=u[0],i=u[1];return c(function(){i(null==t?void 0:t.get(n.current,e))}),f},e.useDescendants=function(){var e=r.useRef(0),t=r.useRef();return t.current||(t.current={}),{get:function(n,r){return t.current[n]||(t.current[n]={index:e.current++}),t.current[n].props=r,t.current[n].index},map:t,reset:function(){e.current=0,t.current={}}}}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).useDescendants={},e.react)}(this,function(e,t){function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var r=n(t),u=r.createContext({}),c="undefined"==typeof window?function(){}:r.useLayoutEffect;e.Descendants=function(e){return e.value.reset(),r.createElement(u.Provider,{value:e.value},e.children)},e.useDescendant=function(e){var t=r.useContext(u),n=r.useRef();n.current||(n.current=Math.random().toString(36).substr(2,9));var o=r.useState(-1),f=o[0],i=o[1];return c(function(){i(null==t?void 0:t.get(n.current,e))}),f},e.useDescendants=function(){var e=r.useRef(0),t=r.useRef();return t.current||(t.current={}),{get:function(n,r){return t.current[n]||(t.current[n]={index:r&&r.hidden?-1:e.current++}),t.current[n].props=r,t.current[n].index},map:t,reset:function(){e.current=0,t.current={}}}}}); |
{ | ||
"name": "use-descendants", | ||
"version": "1.0.0-beta.7", | ||
"version": "1.0.0-beta.8", | ||
"license": "MIT", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.modern.js", | ||
"types": "./dist/index.d.ts", | ||
"source": "./index.tsx", | ||
"source": "./index.js", | ||
"files": [ | ||
@@ -17,5 +16,3 @@ "dist" | ||
"devDependencies": { | ||
"@types/react": "^17.0.17", | ||
"microbundle": "^0.13.3", | ||
"typescript": "^4.3.5" | ||
"microbundle": "^0.13.3" | ||
}, | ||
@@ -22,0 +19,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
6060
5
12