{"id":17462359,"url":"https://github.com/ben-ng/backbone-plus","last_synced_at":"2025-03-28T06:30:45.854Z","repository":{"id":11402462,"uuid":"13849491","full_name":"ben-ng/backbone-plus","owner":"ben-ng","description":"An improved Backbone.js. For use with Browserify.","archived":false,"fork":false,"pushed_at":"2013-12-11T03:20:03.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T00:04:12.667Z","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":"AOKP/system_vold","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ben-ng.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":"2013-10-25T02:13:15.000Z","updated_at":"2013-12-11T03:20:03.000Z","dependencies_parsed_at":"2022-09-22T22:51:45.071Z","dependency_job_id":null,"html_url":"https://github.com/ben-ng/backbone-plus","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fbackbone-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fbackbone-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fbackbone-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-ng%2Fbackbone-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben-ng","download_url":"https://codeload.github.com/ben-ng/backbone-plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245984221,"owners_count":20704787,"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-10-18T08:43:22.228Z","updated_at":"2025-03-28T06:30:45.835Z","avatar_url":"https://github.com/ben-ng.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backbone-Plus\n\n## The Goal\nTo make developing web and mobile apps with Backbone + Browserify easy and predictable, without treading into opinionated framework territory.\n\n## The 30-Second Changelog\n * Comes with `jquery-browserify` out of the box\n * `Backbone.ajax` caches responses to speed up initial view renders\n    * Defaults to `Accept: application/json`, CORS\n\n```js\n// Using caching to improve perceived performance\nvar myView = Backbone.view.extend({\n  initialize: function () {\n    var self = this;\n\n    this.collection = new Things();\n\n    /**\n    * If a cached response is available, `cacheRead` will trigger\n    */\n    this.listenToOnce(this.collection\n      , 'cacheRead'\n      , function (resp) {\n        // Parse the response and update the collection\n        self.collection.set(self.collection.parse(resp));\n        self.render();\n      });\n\n    /**\n    * Perform a fetch.\n    * Note: Even if a cached response was found, the request\n    * will still happen, and this callback will still fire.\n    */\n    this.collection.fetch(function (err) {\n      if(err) return alert(err);\n\n      self.stopListening(self.collection, 'cacheRead')\n\n      self.render();\n    });\n  }\n});\n```\n\n\n * Better error handling in `.save` and `.fetch`\n    * Non - 200, 201, 204 status codes are intepreted as errors\n    * More meaningful error messages (Assumes `message` key in server response)\n * `.save` and `.fetch` now follow node callback conventions\n\n```js\n// Previously:\nmyModel.save({attr: 'changeMe'}, {\n  success: function () {}\n, error: function () {}\n, headers: {}\n});\n\n// Now:\nmyModel.save(function (err) {\n  // etc\n});\n\n// Or with options:\nmyModel.save({\n  headers: {}\n}, function (err) {\n  // etc\n});\n```\n\n## Todo\n * Drop-in compatability with canonical Backbone to make onboarding easier\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) 2013 Ben Ng\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-ng%2Fbackbone-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben-ng%2Fbackbone-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-ng%2Fbackbone-plus/lists"}