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

headless-pagination-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

headless-pagination-react - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

dist/headless-pagination-react.es.js

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

var r=Object.assign;import{useRef as n,useState as t}from"react";import e from"headless-pagination";function o(o){const u=n(new e(o)),[c,i]=t(s());function s(){return{page:u.current.page,links:u.current.links(),hasNext:u.current.hasNext(),hasPrevious:u.current.hasPrevious(),from:u.current.from(),to:u.current.to()}}function a(){i(s())}return r(r({},c),{setPage:function(r){u.current.setPage(r),a()},onNext:function(){u.current.onNext(),a()},onPrevious:function(){u.current.onPrevious(),a()}})}export default o;
var e=Object.assign;import{useRef as t,useState as r,useEffect as n}from"react";import o from"headless-pagination";function s(s){const a=t(new o(s)),[u,i]=r(c());function c(){return{page:a.current.page,links:a.current.links(),hasNext:a.current.hasNext(),hasPrevious:a.current.hasPrevious(),from:a.current.from(),to:a.current.to()}}function m(){i(c())}return n((()=>{void 0!==s.maxLinks&&a.current.setMaxLinks(s.maxLinks),void 0!==s.perPage&&a.current.setPerPage(s.perPage),void 0!==s.totalItems&&a.current.setTotalItems(s.totalItems),m()}),[s.maxLinks,s.perPage,s.totalItems]),e(e({},u),{setPage:function(e){a.current.setPage(e),m()},onNext:function(){a.current.onNext(),m()},onPrevious:function(){a.current.onPrevious(),m()}})}export default s;

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

var __assign=Object.assign;!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react"),require("headless-pagination")):"function"==typeof define&&define.amd?define(["react","headless-pagination"],n):(e="undefined"!=typeof globalThis?globalThis:e||self)["headless-pagination-react"]=n(e.react,e.Paginator)}(this,(function(e,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n);return function(n){const t=e.useRef(new r.default(n)),[o,i]=e.useState(u());function u(){return{page:t.current.page,links:t.current.links(),hasNext:t.current.hasNext(),hasPrevious:t.current.hasPrevious(),from:t.current.from(),to:t.current.to()}}function s(){i(u())}return __assign(__assign({},o),{setPage:function(e){t.current.setPage(e),s()},onNext:function(){t.current.onNext(),s()},onPrevious:function(){t.current.onPrevious(),s()}})}}));
var __assign=Object.assign;!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("headless-pagination")):"function"==typeof define&&define.amd?define(["react","headless-pagination"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["headless-pagination-react"]=t(e.react,e.Paginator)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);return function(t){const n=e.useRef(new r.default(t)),[s,a]=e.useState(o());function o(){return{page:n.current.page,links:n.current.links(),hasNext:n.current.hasNext(),hasPrevious:n.current.hasPrevious(),from:n.current.from(),to:n.current.to()}}function i(){a(o())}return e.useEffect((()=>{void 0!==t.maxLinks&&n.current.setMaxLinks(t.maxLinks),void 0!==t.perPage&&n.current.setPerPage(t.perPage),void 0!==t.totalItems&&n.current.setTotalItems(t.totalItems),i()}),[t.maxLinks,t.perPage,t.totalItems]),__assign(__assign({},s),{setPage:function(e){n.current.setPage(e),i()},onNext:function(){n.current.onNext(),i()},onPrevious:function(){n.current.onPrevious(),i()}})}}));

@@ -6,3 +6,3 @@ import { PaginatorOptions } from 'headless-pagination';

onPrevious: () => void;
page: number;
page: () => number;
links: import("headless-pagination").PaginatorLink[];

@@ -9,0 +9,0 @@ hasNext: boolean;

{
"name": "headless-pagination-react",
"version": "0.1.2",
"version": "0.1.3",
"description": "Headless pagination library for react with hooks",

@@ -14,3 +14,3 @@ "author": "Ozzie Neher @ozziexsh",

"dependencies": {
"headless-pagination": "^0.1.2"
"headless-pagination": "^0.1.3"
},

@@ -32,3 +32,3 @@ "peerDependencies": {

],
"gitHead": "add9661ede180a0a52f45c1bd50cd13c315f6774"
"gitHead": "f46d5150148d64934fce895f5f20b45ecda62fdb"
}
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