{"id":18459552,"url":"https://github.com/griddlegriddle/griddle-remote-plugin","last_synced_at":"2025-04-23T17:39:47.203Z","repository":{"id":82010780,"uuid":"44642925","full_name":"GriddleGriddle/griddle-remote-plugin","owner":"GriddleGriddle","description":"A plugin for loading data remotely.","archived":false,"fork":false,"pushed_at":"2016-11-01T02:41:23.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-16T15:36:59.843Z","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":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GriddleGriddle.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-21T00:30:58.000Z","updated_at":"2016-01-24T23:53:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"a75ae81a-3e6b-40fe-ac90-6ef41bf158db","html_url":"https://github.com/GriddleGriddle/griddle-remote-plugin","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/GriddleGriddle%2Fgriddle-remote-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GriddleGriddle%2Fgriddle-remote-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GriddleGriddle%2Fgriddle-remote-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GriddleGriddle%2Fgriddle-remote-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GriddleGriddle","download_url":"https://codeload.github.com/GriddleGriddle/griddle-remote-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250482006,"owners_count":21437819,"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-11-06T08:23:36.773Z","updated_at":"2025-04-23T17:39:47.182Z","avatar_url":"https://github.com/GriddleGriddle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## :warning: Deprecated :warning:\n\n###  Please find 1.0 updates in the [1.0-combined](https://github.com/GriddleGriddle/Griddle/tree/1.0-combined) branch.\n\n# Griddle Remote Plugin (BETA)\n\nThe remote plugin provides a configurable way to load data that might not be available locally.\n\nInstall with `npm install griddle-remote-plugin` and import or require the\nplugin. The remote plugin allows you to specify the request / response format,\nas well as specify the provider used for loading data (such as `superagent` or\nyour own).\n\n```\nimport { RemotePlugin, superagentProvider } from 'griddle-remote-plugin';\n...\nconst optionalConfig = {...};\n\u003cGriddle ... plugins={[RemotePlugin(superagentProvider, remoteConfig)]}\n```\n\n## Configuration\nAt the moment, but `superagent` is the only remote provider available, but support for Axios is planned.\n\n### Superagent Provider Config:\n```\nurl, // The URL of your API : string\nrequestHeaders, // Any headers needed by your API endpoint : array\nformatRequest, //  : function(superagentRequest, tableState)\nformatSuccess, // : function(response, tableState)\nformatError // : function(requestError, errorResponseBody)\n```\n\nThe `tableState` param includes information about the state of the table that is being requested.\n```\n{\n  page, // The page being requested : int\n  pageSize, // The page size being requested : int\n  filter, // The table filter : string\n  sortColumn, // The sort columns : array\n  sortDirection // The sort direction : string, 'asc' or 'desc'\n}\n```\n\nExpected returned value from the `formatSuccess` function:\n```\n{ data, totalCount, page, maxPage }\n```\n\n#### Example config:\n```\n{\n  url: 'http://swapi.co/api/planets/',\n  formatSuccess: function(response, tableState) {\n    const { page, pageSize } = tableState;\n    // Update the response\n    return {\n      data: response.results,\n      totalCount: response.count,\n      page: page,\n      maxPage: Math.ceil(response.count / pageSize)\n    }\n  }\n}\n```\n\n## Planned Features\n1. Error handling\n1. Support for Axios\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgriddlegriddle%2Fgriddle-remote-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgriddlegriddle%2Fgriddle-remote-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgriddlegriddle%2Fgriddle-remote-plugin/lists"}