react-reducer-ssr
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -1,1 +0,1 @@ | ||
"use strict";var t=require("react"),r=require("react/jsx-runtime");function e(t){}function n(t){return t&&"function"==typeof t.then}function o(t,r){return function(e){return new Promise((function(o,u){n(e)?e.then((function(e){i(e,t,r,o,u)})).catch((function(t){return u(t)})):(i(e,t,r,o,u),o())}))}}function i(t,r,e,o,i){if("function"==typeof t){var u=t(r,{},e);n(u)?u.then((function(t){o()})).catch((function(t){return i(t)})):o()}else r(t),o()}function u(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,u,c=[],a=!0,f=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;a=!1}else for(;!(a=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);a=!0);}catch(t){f=!0,o=t}finally{try{if(!a&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(f)throw o}}return c}}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return c(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return c(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var a=t.createContext(null),f=t.createContext(null);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function p(t,r,e){return(r=function(t){var r=function(t,r){if("object"!==l(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===l(r)?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}exports.NullDispatch=e,exports.RootContextProvider=function(e){var n=e.children,i=e.reducer,c=e.customParams,l=e.initialState,s=u(t.useReducer(i,l),2),p=s[0],y=s[1];return r.jsx(a.Provider,{value:p,children:r.jsx(f.Provider,{value:o(y,c),children:n})})},exports.combineReducers=function(t){return function(r,e){r=r||{};var n=!1;return Object.keys(t).forEach((function(o){var i=t[o];if(i){var u=i(r[o]||{},e);u!==r[o]&&(r[o]=u,n=!0)}})),n?function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?s(Object(e),!0).forEach((function(r){p(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({},r):r}},exports.createServerStore=function(t,r,e){var n={root:e||{},dispatch:o((function(r){n.root=t(n.root,r)}),r)};return n.dispatch({type:"@@INIT"}),n},exports.isPromise=n,exports.useStateDispatch=function(){return t.useContext(f)||e},exports.useStateSelectorT=function(r){var e=t.useContext(a);return r&&e?r(e):e},exports.wrapDispatchWithAsync=o; | ||
"use strict";var t=require("react"),r=require("react/jsx-runtime");function e(t){}function n(t){return t&&"function"==typeof t.then}function o(t,r){return function(e){return new Promise((function(o,u){n(e)?e.then((function(e){i(e,t,r,o,u)})).catch((function(t){return u(t)})):i(e,t,r,o,u)}))}}function i(t,r,e,o,i){if("function"==typeof t){var u=t(r,{},e);n(u)?u.then((function(t){o()})).catch((function(t){return i(t)})):o()}else r(t),o()}function u(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,u,c=[],a=!0,f=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;a=!1}else for(;!(a=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);a=!0);}catch(t){f=!0,o=t}finally{try{if(!a&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(f)throw o}}return c}}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return c(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return c(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var a=t.createContext(null),f=t.createContext(null);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function p(t,r,e){return(r=function(t){var r=function(t,r){if("object"!==l(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===l(r)?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}exports.NullDispatch=e,exports.RootContextProvider=function(e){var n=e.children,i=e.reducer,c=e.customParams,l=e.initialState,s=u(t.useReducer(i,l),2),p=s[0],y=s[1];return r.jsx(a.Provider,{value:p,children:r.jsx(f.Provider,{value:o(y,c),children:n})})},exports.combineReducers=function(t){return function(r,e){r=r||{};var n=!1;return Object.keys(t).forEach((function(o){var i=t[o];if(i){var u=i(r[o]||{},e);u!==r[o]&&(r[o]=u,n=!0)}})),n?function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?s(Object(e),!0).forEach((function(r){p(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({},r):r}},exports.createServerStore=function(t,r,e){var n={root:e||{},dispatch:o((function(r){n.root=t(n.root,r)}),r)};return n.dispatch({type:"@@INIT"}),n},exports.isPromise=n,exports.useStateDispatch=function(){return t.useContext(f)||e},exports.useStateSelectorT=function(r){var e=t.useContext(a);return r&&e?r(e):e},exports.wrapDispatchWithAsync=o; |
@@ -1,1 +0,1 @@ | ||
import{useReducer as r,useContext as t,createContext as n}from"react";import{jsx as e}from"react/jsx-runtime";function o(r,t,n){var e={root:n||{},dispatch:c((function(t){e.root=r(e.root,t)}),t)};return e.dispatch({type:"@@INIT"}),e}function i(r){}function u(r){return r&&"function"==typeof r.then}function c(r,t){return function(n){return new Promise((function(e,o){u(n)?n.then((function(n){f(n,r,t,e,o)})).catch((function(r){return o(r)})):(f(n,r,t,e,o),e())}))}}function f(r,t,n,e,o){if("function"==typeof r){var i=r(t,{},n);u(i)?i.then((function(r){e()})).catch((function(r){return o(r)})):e()}else t(r),e()}function a(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var e,o,i,u,c=[],f=!0,a=!1;try{if(i=(n=n.call(r)).next,0===t){if(Object(n)!==n)return;f=!1}else for(;!(f=(e=i.call(n)).done)&&(c.push(e.value),c.length!==t);f=!0);}catch(r){a=!0,o=r}finally{try{if(!f&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(a)throw o}}return c}}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return l(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}var y=n(null),b=n(null);function p(t){var n=t.children,o=t.reducer,i=t.customParams,u=t.initialState,f=a(r(o,u),2),l=f[0],p=f[1];return e(y.Provider,{value:l,children:e(b.Provider,{value:c(p,i),children:n})})}function s(r){var n=t(y);return r&&n?r(n):n}function m(){return t(b)||i}function v(r){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},v(r)}function h(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.push.apply(n,e)}return n}function O(r,t,n){return(t=function(r){var t=function(r,t){if("object"!==v(r)||null===r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var e=n.call(r,t||"default");if("object"!==v(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"===v(t)?t:String(t)}(t))in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function d(r){return function(t,n){t=t||{};var e=!1;return Object.keys(r).forEach((function(o){var i=r[o];if(i){var u=i(t[o]||{},n);u!==t[o]&&(t[o]=u,e=!0)}})),e?function(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){O(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}({},t):t}}export{i as NullDispatch,p as RootContextProvider,d as combineReducers,o as createServerStore,u as isPromise,m as useStateDispatch,s as useStateSelectorT,c as wrapDispatchWithAsync}; | ||
import{useReducer as r,useContext as t,createContext as n}from"react";import{jsx as e}from"react/jsx-runtime";function o(r,t,n){var e={root:n||{},dispatch:c((function(t){e.root=r(e.root,t)}),t)};return e.dispatch({type:"@@INIT"}),e}function i(r){}function u(r){return r&&"function"==typeof r.then}function c(r,t){return function(n){return new Promise((function(e,o){u(n)?n.then((function(n){f(n,r,t,e,o)})).catch((function(r){return o(r)})):f(n,r,t,e,o)}))}}function f(r,t,n,e,o){if("function"==typeof r){var i=r(t,{},n);u(i)?i.then((function(r){e()})).catch((function(r){return o(r)})):e()}else t(r),e()}function a(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var e,o,i,u,c=[],f=!0,a=!1;try{if(i=(n=n.call(r)).next,0===t){if(Object(n)!==n)return;f=!1}else for(;!(f=(e=i.call(n)).done)&&(c.push(e.value),c.length!==t);f=!0);}catch(r){a=!0,o=r}finally{try{if(!f&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(a)throw o}}return c}}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return l(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}var y=n(null),b=n(null);function p(t){var n=t.children,o=t.reducer,i=t.customParams,u=t.initialState,f=a(r(o,u),2),l=f[0],p=f[1];return e(y.Provider,{value:l,children:e(b.Provider,{value:c(p,i),children:n})})}function s(r){var n=t(y);return r&&n?r(n):n}function m(){return t(b)||i}function v(r){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},v(r)}function h(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.push.apply(n,e)}return n}function O(r,t,n){return(t=function(r){var t=function(r,t){if("object"!==v(r)||null===r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var e=n.call(r,t||"default");if("object"!==v(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"===v(t)?t:String(t)}(t))in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function d(r){return function(t,n){t=t||{};var e=!1;return Object.keys(r).forEach((function(o){var i=r[o];if(i){var u=i(t[o]||{},n);u!==t[o]&&(t[o]=u,e=!0)}})),e?function(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){O(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}({},t):t}}export{i as NullDispatch,p as RootContextProvider,d as combineReducers,o as createServerStore,u as isPromise,m as useStateDispatch,s as useStateSelectorT,c as wrapDispatchWithAsync}; |
{ | ||
"name": "react-reducer-ssr", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"homepage": "https://github.com/alfed7/react-reducer-ssr", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/alfed7/react-reducer-ssr", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
64778