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

@washingtonpost/red-react-lib

Package Overview
Dependencies
Maintainers
124
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@washingtonpost/red-react-lib - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

index.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var react=require("react");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_nonIterableRest()}function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_nonIterableRest()}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_nonIterableSpread()}function _arrayWithoutHoles(r){if(Array.isArray(r)){for(var e=0,t=new Array(r.length);e<r.length;e++)t[e]=r[e];return t}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _iterableToArray(r){if(Symbol.iterator in Object(r)||"[object Arguments]"===Object.prototype.toString.call(r))return Array.from(r)}function _iterableToArrayLimit(r,e){var t=[],n=!0,a=!1,o=void 0;try{for(var u,i=r[Symbol.iterator]();!(n=(u=i.next()).done)&&(t.push(u.value),!e||t.length!==e);n=!0);}catch(r){a=!0,o=r}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return t}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var setLoading=function(r){return{result:r.result,loading:!0}};function usePromiseCallback(r){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=_slicedToArray(react.useState({}),2),a=n[0],o=n[1],u=react.useRef(0),i=react.useRef(0),c=react.useCallback(function(){t?(clearTimeout(u.current),u.current=setTimeout(function(){return o(setLoading)},t)):o(setLoading);var e=++i.current;r.apply(void 0,arguments).then(function(r){return e===i.current&&o({result:r})}).catch(function(r){return e===i.current&&o({err:r})}).finally(function(){return e===i.current&&clearTimeout(u.current)})},e);return react.useEffect(function(){i.current=0,clearTimeout(u.current)},[]),[c,a.result,a.loading,a.err]}function usePromise(r){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],t=_toArray(usePromiseCallback(r,e,2<arguments.length&&void 0!==arguments[2]?arguments[2]:0)),n=t[0],a=t.slice(1),o=react.useCallback(function(){return n.apply(void 0,_toConsumableArray(e))},[n]);return react.useEffect(function(){o.apply(void 0,_toConsumableArray(e))},[o]),[o].concat(_toConsumableArray(a))}function usePrevious(r){var e=react.useRef();return react.useEffect(function(){e.current=r},[r]),e.current}var index=Object.freeze({usePromiseCallback:usePromiseCallback,usePromise:usePromise,usePrevious:usePrevious});exports.hooks=index;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),React__default=_interopDefault(React),reactRouterDom=require("react-router-dom"),qs=_interopDefault(require("qs"));function usePrevious(e){var r=React.useRef();return React.useEffect(function(){r.current=e},[e]),r.current}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},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(e){_defineProperty(r,e,t[e])})}return r}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_nonIterableRest()}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _iterableToArrayLimit(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(n=(u=i.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return t}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var setLoading=function(e){return{result:e.result,loading:!0}};function usePromiseCallback(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=_slicedToArray(React.useState({}),2),o=n[0],a=n[1],u=React.useRef(0),i=React.useRef(0),c=React.useCallback(function(){t?(clearTimeout(u.current),u.current=setTimeout(function(){return a(setLoading)},t)):a(setLoading);var r=++i.current;e.apply(void 0,arguments).then(function(e){return r===i.current&&a({result:e})}).catch(function(e){return r===i.current&&a({err:e})}).finally(function(){return r===i.current&&clearTimeout(u.current)})},r);return React.useEffect(function(){i.current=0,clearTimeout(u.current)},[]),[c,o.result,o.loading,o.err]}function usePromise(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],t=_toArray(usePromiseCallback(e,r,2<arguments.length&&void 0!==arguments[2]?arguments[2]:0)),n=t[0],o=t.slice(1),a=React.useCallback(function(){return n.apply(void 0,_toConsumableArray(r))},[n]);return React.useEffect(function(){a.apply(void 0,_toConsumableArray(r))},[a]),[a].concat(_toConsumableArray(o))}var defaultOptions={ignoreQueryPrefix:!0,interpretNumericEntities:!0};function useRouter(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:defaultOptions,r=reactRouterDom.useParams(),t=reactRouterDom.useLocation(),i=reactRouterDom.useHistory(),n=reactRouterDom.useRouteMatch();return React__default.useMemo(function(){var u=qs.parse(t.search,e);return{push:i.push,replace:i.replace,pathname:t.pathname,query:u,setQuery:function(r,e){var t=(1<arguments.length&&void 0!==e?e:{}).method,n=void 0===t?"push":t,o="function"==typeof r?r:function(e){return _objectSpread({},e,r)},a=qs.stringify(o(u));i[n]("?".concat(a))},params:r,match:n,location:t,history:i}},[r,n,t,i,e])}var index=Object.freeze({usePrevious:usePrevious,usePromise:usePromise,usePromiseCallback:usePromiseCallback,useRouter:useRouter});exports.hooks=index;

@@ -98,4 +98,4 @@ {

},
"version": "2.0.0",
"gitHead": "74da3a50cf8ea42d05c4d7681815fa641d60b1a0"
"version": "2.0.1",
"gitHead": "24eb60abe38755ed8e212b51e31ea1d72de4b236"
}

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

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

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