use-descendants
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
@@ -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=r.createContext({});exports.Descendants=function(e){return e.value.reset(),h(t.Provider,{value:e.value},e.children)},exports.useDescendant=function(e){var n=r.useContext(t),u=r.useRef();return u.current||(u.current=Math.random().toString(36).substr(2,9)),null==n?void 0:n.get(u.current,e)},exports.useDescendants=function(){var e=r.useRef(0),t=r.useRef();t.current||(t.current={});var n=function(){e.current=0,t.current={}},u=function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current};return r.useMemo(function(){return{get:u,map:t,reset:n}},[])}; | ||
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({});exports.Descendants=function(e){return e.value.reset(),r.createElement(t.Provider,{value:e.value},e.children)},exports.useDescendant=function(e){var n=r.useContext(t),u=r.useRef();return u.current||(u.current=Math.random().toString(36).substr(2,9)),null==n?void 0:n.get(u.current,e)},exports.useDescendants=function(){var e=r.useRef(0),t=r.useRef();t.current||(t.current={});var n=function(){e.current=0,t.current={}},u=function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current};return r.useMemo(function(){return{get:u,map:t,reset:n}},[])}; |
@@ -1,1 +0,1 @@ | ||
import*as r from"react";var e=r.createContext({}),t=function(r){return r.value.reset(),h(e.Provider,{value:r.value},r.children)},n=function(){var e=r.useRef(0),t=r.useRef();t.current||(t.current={});var n=function(){e.current=0,t.current={}},u=function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current};return r.useMemo(function(){return{get:u,map:t,reset:n}},[])};function u(t){var n=r.useContext(e),u=r.useRef();return u.current||(u.current=Math.random().toString(36).substr(2,9)),null==n?void 0:n.get(u.current,t)}export{t as Descendants,u as useDescendant,n as useDescendants}; | ||
import*as r from"react";var e=r.createContext({}),t=function(t){return t.value.reset(),r.createElement(e.Provider,{value:t.value},t.children)},n=function(){var e=r.useRef(0),t=r.useRef();t.current||(t.current={});var n=function(){e.current=0,t.current={}},u=function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current};return r.useMemo(function(){return{get:u,map:t,reset:n}},[])};function u(t){var n=r.useContext(e),u=r.useRef();return u.current||(u.current=Math.random().toString(36).substr(2,9)),null==n?void 0:n.get(u.current,t)}export{t as Descendants,u as useDescendant,n 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 r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var n=r(t),u=n.createContext({});e.Descendants=function(e){return e.value.reset(),h(u.Provider,{value:e.value},e.children)},e.useDescendant=function(e){var t=n.useContext(u),r=n.useRef();return r.current||(r.current=Math.random().toString(36).substr(2,9)),null==t?void 0:t.get(r.current,e)},e.useDescendants=function(){var e=n.useRef(0),t=n.useRef();t.current||(t.current={});var r=function(){e.current=0,t.current={}},u=function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current};return n.useMemo(function(){return{get:u,map:t,reset: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||self).useDescendants={},e.react)}(this,function(e,t){function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var n=r(t),u=n.createContext({});e.Descendants=function(e){return e.value.reset(),n.createElement(u.Provider,{value:e.value},e.children)},e.useDescendant=function(e){var t=n.useContext(u),r=n.useRef();return r.current||(r.current=Math.random().toString(36).substr(2,9)),null==t?void 0:t.get(r.current,e)},e.useDescendants=function(){var e=n.useRef(0),t=n.useRef();t.current||(t.current={});var r=function(){e.current=0,t.current={}},u=function(r,n){return t.current[r]||(t.current[r]={index:e.current++}),t.current[r].props=n,t.current};return n.useMemo(function(){return{get:u,map:t,reset:r}},[])}}); |
{ | ||
"name": "use-descendants", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"license": "MIT", | ||
@@ -13,3 +13,3 @@ "main": "./dist/index.js", | ||
"prepublish": "yarn build", | ||
"build": "microbundle --compress --no-sourcemap" | ||
"build": "microbundle --compress --no-sourcemap --jsx React.createElement" | ||
}, | ||
@@ -16,0 +16,0 @@ "devDependencies": { |
5307