{"id":23058663,"url":"https://github.com/suhdev/stickyants-ui-pagination","last_synced_at":"2025-09-14T06:46:26.376Z","repository":{"id":57370932,"uuid":"161404206","full_name":"suhdev/stickyants-ui-pagination","owner":"suhdev","description":"A pagination UI component for React apps","archived":false,"fork":false,"pushed_at":"2019-01-31T11:11:34.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:12:13.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-11T22:56:28.000Z","updated_at":"2019-02-26T07:10:00.000Z","dependencies_parsed_at":"2022-09-09T01:12:48.194Z","dependency_job_id":null,"html_url":"https://github.com/suhdev/stickyants-ui-pagination","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-ui-pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-ui-pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-ui-pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-ui-pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhdev","download_url":"https://codeload.github.com/suhdev/stickyants-ui-pagination/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944383,"owners_count":20858772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T02:16:55.221Z","updated_at":"2025-04-03T06:18:39.089Z","avatar_url":"https://github.com/suhdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sa-pagination \n\nA pagination component for React/mobx applications that uses the MVVM structure. \n\n## Usage \n\nTypical usage is for a model that wraps a list of items. See the example below: \n\n```typescript\nimport * as React from 'react'; \nimport * as ReactDOM from 'react-dom'; \n\nimport {observable,computed,action} from 'mobx'; \nimport {Pagination,IPaginationModel} from 'stickyants-ui-pagination'; \n\nclass MockModel implements IPaginationModel {\n    @observable.ref itemsPerPage: number = 10; \n    @observable.ref page:number = 1; \n    @observable.ref items:any = [1,2,3,4,5,6,7,8,9,10];\n    @observable.ref totalCount:number = 100; \n    \n\n    @computed get totalPages(){\n        return Math.ceil(this.totalCount/this.itemsPerPage);\n    }\n\n    @action.bound\n    onNextPage(){\n        if (this.page \u003c (this.totalPages - 1)){\n            this.page++; \n        }\n    }\n\n    @action.bound\n    onPrevPage(){\n        if (this.page \u003e 1){\n            this.page--;\n        }\n    }  \n    \n    initReactions(){\n\n    }\n}\n\nconst model = new MockModel(); \n\nfunction fetchData(page){\n    setTimeout(()=\u003e{\n        if (page === model.page){\n            model.items = model.items.map(e=\u003ee * page); \n        }\n    },200);\n}\n\nreaction(()=\u003emodel.page,fetchData); \n\nReactDOM.render(\u003cPagination model={model} /\u003e,\n    document.getElementById(\"Pagination\"));\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhdev%2Fstickyants-ui-pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhdev%2Fstickyants-ui-pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhdev%2Fstickyants-ui-pagination/lists"}