{"id":32226713,"url":"https://github.com/bearchit/listfetcher","last_synced_at":"2025-10-22T09:55:49.768Z","repository":{"id":26065246,"uuid":"29508894","full_name":"bearchit/ListFetcher","owner":"bearchit","description":null,"archived":false,"fork":false,"pushed_at":"2015-01-28T08:10:16.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-10-22T09:55:49.042Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CoderMJLee/MJRefresh","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bearchit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-20T02:59:17.000Z","updated_at":"2015-01-28T08:10:16.000Z","dependencies_parsed_at":"2022-08-24T15:03:31.658Z","dependency_job_id":null,"html_url":"https://github.com/bearchit/ListFetcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bearchit/ListFetcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearchit%2FListFetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearchit%2FListFetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearchit%2FListFetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearchit%2FListFetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bearchit","download_url":"https://codeload.github.com/bearchit/ListFetcher/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearchit%2FListFetcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280416597,"owners_count":26327044,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-22T09:55:48.403Z","updated_at":"2025-10-22T09:55:49.760Z","avatar_url":"https://github.com/bearchit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ListFetcher\n\n## About\n\nListFetcher는 데이터 원본으로부터 다양한 형태로 제공되는 데이터를 일관적인 방법으로 획득/접근할 수 있도록 하는 인터페이스를 제공하는 라이브러리입니다.\n\nListFetcher는 다음과 같은 기능을 제공합니다.\n* 데이터 원본으로부터 데이터를 가져오는 방법을 정의\n* 기본적인 Array 이외의 다양한 데이터 타입을 지원\n* 페이징된 데이터 원본으로부터 데이터 획득\n\n## Installation\n\nUsing Bower:\n\n    bower install list-fetcher\n\n## Usage\n\n### 인스턴스 생성\n```javascript\nvar listFetcher = new ListFetcher();\n```\n\n### 인스턴스 생성시에 페이징 정보 설정\n인스턴스 생성시에 페이징과 관련된 정보를 설정할 수 있습니다. 설정하지 않을시에는 기본값 perIndex: 1, perPage: 10으로 설정됩니다.\n```javascript\nvar ListFetcher = new ListFetcher({pageIndex:1, perPage:20});\n```\n\n### 인스턴스 생성후에 해야 할 일\n#### fetcher 설정\nListFetcher는 fetcher 메서드에서 지정한 방법대로 데이터 원본으로부터 데이터를 취득합니다. 취득한 데이터는 ListFetcher 인스턴스 내부의 data 변수에 추가되게 됩니다.\n\n```javascript\n// Remote server로부터 데이터를 획득하는 fetcher 예제\nlistFetcher.fetcher = function(pageIndex, perPgae) {\n  Restangular.all('/api/v1/posts.json').getList().then(function(resp) {\n    return resp;\n  });\n};\n```\n\n### Array 이외의 데이터 형식을 사용해야 할 때\nListFetcher는 기본적으로 Array 타입의 데이터를 지원합니다. Array 이외의 Object와 같은 데이터 타입을 지원하려면 concatenator 메서드를 정의하면 됩니다.\n\n```javascript\n// Object 데이터 타입을 지원하는 예제\nvar nonArrayListFetcher = new ListFetcher();\n\nnonArrayListFetcher.concatenator = function(newData) {\n  if(!this.data.hasOwnProperty('teams')) {\n    this.data.teams = [];\n  }\n\n  this.data.teams = this.data.teams.concat(newData.teams);\n};\n\nnonArrayListFetcher.addMore();\n```\n\n### 데이터 가져오기\naddMore() 메서드로 페이징의 다음 데이터를 가져올 수 있습니다.\n\n```javascript\nlistFetcher.addMore();\nconsole.log(listFetcher.data);\n```\n\n\n## Contributing\n\nWe'll check out your contribution if you:\n\n* Provide a comprehensive suite of tests for your fork.\n* Have a clear and documented rationale for your changes.\n* Package these up in a pull request.\n\nWe'll do our best to help you out with any contribution issues you may have.\n\n## License\n\nMIT. See `LICENSE.txt` in this directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearchit%2Flistfetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearchit%2Flistfetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearchit%2Flistfetcher/lists"}