redux-bundler-hook
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,n=t.createContext(null);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){o(e,r,t[r])})}return e}function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=[],n=!0,o=!1,u=void 0;try{for(var c,i=e[Symbol.iterator]();!(n=(c=i.next()).done)&&(t.push(c.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw u}}return t}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}exports.ReduxBundlerProvider=function(e){return t.createElement(n.Provider,{value:{store:e.store}},e.children)},exports.useConnect=function(){for(var e=arguments,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=e[i];var a=r.useContext(n).store,f=c(r.useMemo(function(){return function(e,r){var t=[],n={};return r.forEach(function(r){if("select"!==r.slice(0,6)){if("do"!==r.slice(0,2))throw Error("Can Not Connect: ".concat(r));n[r]=function(){for(var t=arguments,n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=t[u];return e.action?e.action(r,o):e[r].apply(e,o)}}else t.push(r)}),[t,n]}(a,o)},o),2),l=f[0],s=f[1],y=c(r.useState(function(){return a.select(l)}),2),b=y[0],v=y[1],p=r.useRef(l);return r.useEffect(function(){return p.current!==l&&(p.current=l,v(a.select(l))),a.subscribeToSelectors(l,function(e){v(function(r){return u({},r,e)})})},[l]),u({},s,p.current!==l?a.select(l):b)}; | ||
var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,n=t.createContext({store:null});function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){o(e,r,t[r])})}return e}function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=[],n=!0,o=!1,u=void 0;try{for(var c,i=e[Symbol.iterator]();!(n=(c=i.next()).done)&&(t.push(c.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw u}}return t}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}exports.ReduxBundlerContext=n,exports.ReduxBundlerProvider=function(e){return t.createElement(n.Provider,{value:{store:e.store}},e.children)},exports.useConnect=function(){for(var e=arguments,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=e[i];var l=r.useContext(n).store,a=c(r.useMemo(function(){return function(e,r){var t=[],n={};return r.forEach(function(r){if("select"!==r.slice(0,6)){if("do"!==r.slice(0,2))throw Error("Can Not Connect: ".concat(r));n[r]=function(){for(var t=arguments,n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=t[u];return e.action?e.action(r,o):e[r].apply(e,o)}}else t.push(r)}),[t,n]}(l,o)},o),2),f=a[0],s=a[1],y=c(r.useState(function(){return l.select(f)}),2),d=y[0],p=y[1],b=r.useRef(f);return r.useEffect(function(){return b.current!==f&&(b.current=f,p(l.select(f))),l.subscribeToSelectors(f,function(e){p(function(r){return u({},r,e)})})},[f]),u({},s,b.current!==f?l.select(f):d)},exports.useReduxBundlerStore=function(){return r.useContext(n).store}; | ||
//# sourceMappingURL=index.js.map |
@@ -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.reduxBundlerHook={},e.react)}(this,function(e,t){var r="default"in t?t.default:t,n=r.createContext(null);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){o(e,t,r[t])})}return e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var c,i=e[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}e.ReduxBundlerProvider=function(e){return r.createElement(n.Provider,{value:{store:e.store}},e.children)},e.useConnect=function(){for(var e=arguments,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=e[i];var f=t.useContext(n).store,a=c(t.useMemo(function(){return function(e,t){var r=[],n={};return t.forEach(function(t){if("select"!==t.slice(0,6)){if("do"!==t.slice(0,2))throw Error("Can Not Connect: ".concat(t));n[t]=function(){for(var r=arguments,n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=r[u];return e.action?e.action(t,o):e[t].apply(e,o)}}else r.push(t)}),[r,n]}(f,o)},o),2),l=a[0],s=a[1],d=c(t.useState(function(){return f.select(l)}),2),y=d[0],p=d[1],b=t.useRef(l);return t.useEffect(function(){return b.current!==l&&(b.current=l,p(f.select(l))),f.subscribeToSelectors(l,function(e){p(function(t){return u({},t,e)})})},[l]),u({},s,b.current!==l?f.select(l):y)}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.reduxBundlerHook={},e.react)}(this,function(e,t){var r="default"in t?t.default:t,n=r.createContext({store:null});function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){o(e,t,r[t])})}return e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var c,i=e[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}e.ReduxBundlerContext=n,e.ReduxBundlerProvider=function(e){return r.createElement(n.Provider,{value:{store:e.store}},e.children)},e.useConnect=function(){for(var e=arguments,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=e[i];var f=t.useContext(n).store,a=c(t.useMemo(function(){return function(e,t){var r=[],n={};return t.forEach(function(t){if("select"!==t.slice(0,6)){if("do"!==t.slice(0,2))throw Error("Can Not Connect: ".concat(t));n[t]=function(){for(var r=arguments,n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=r[u];return e.action?e.action(t,o):e[t].apply(e,o)}}else r.push(t)}),[r,n]}(f,o)},o),2),l=a[0],s=a[1],d=c(t.useState(function(){return f.select(l)}),2),y=d[0],p=d[1],b=t.useRef(l);return t.useEffect(function(){return b.current!==l&&(b.current=l,p(f.select(l))),f.subscribeToSelectors(l,function(e){p(function(t){return u({},t,e)})})},[l]),u({},s,b.current!==l?f.select(l):y)},e.useReduxBundlerStore=function(){return t.useContext(n).store}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "redux-bundler-hook", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "React bindings to redux-bundler with hooks", | ||
@@ -27,11 +27,13 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.3.1", | ||
"@babel/preset-env": "^7.4.4", | ||
"@babel/preset-react": "^7.0.0", | ||
"babel-jest": "^24.1.0", | ||
"jest": "^24.1.0", | ||
"microbundle": "^0.10.0", | ||
"prettier": "^1.16.4", | ||
"babel-jest": "^24.7.1", | ||
"jest": "^24.7.1", | ||
"microbundle": "^0.11.0", | ||
"prettier": "^1.17.0", | ||
"react": "^16.8.3", | ||
"react-dom": "^16.8.3", | ||
"react-testing-library": "^5.9.0", | ||
"react-dom": "^16.8.6", | ||
"react-hooks-testing-library": "^0.5.0", | ||
"react-test-renderer": "^16.8.6", | ||
"react-testing-library": "^7.0.0", | ||
"redux-bundler": "^23.1.0" | ||
@@ -53,4 +55,4 @@ }, | ||
"redux-bundler": "*", | ||
"react": ">=16.8.0" | ||
"react": ">=16.8.6" | ||
} | ||
} |
# Redux-Bundler Hook | ||
![](https://img.shields.io/npm/v/redux-bundler-hook.svg)![](https://img.shields.io/npm/dt/redux-bundler-hook.svg) | ||
![](https://img.shields.io/npm/v/redux-bundler-hook.svg) ![](https://img.shields.io/npm/dt/redux-bundler-hook.svg) [![CircleCI](https://circleci.com/gh/abuinitski/redux-bundler-hook/tree/master.svg?style=svg)](https://circleci.com/gh/abuinitski/redux-bundler-hook/tree/master) | ||
@@ -56,1 +56,3 @@ React.js bindings to Henrik Joreteg's [redux-bundler](https://github.com/HenrikJoreteg/redux). | ||
``` | ||
In cases you need a store itself down your component tree, this package also exports `useReduxBundlerStore` hook that will return the store. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
19780
9
27
58
12