{"id":13499654,"url":"https://github.com/beanworks/React.withBackbone","last_synced_at":"2025-03-29T05:31:58.909Z","repository":{"id":57398383,"uuid":"91398817","full_name":"beanworks/React.withBackbone","owner":"beanworks","description":"React Backbone Binding that works with React 16","archived":false,"fork":false,"pushed_at":"2017-05-18T06:29:06.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-26T00:08:15.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://beanworks.github.io/React.withBackbone/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beanworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-16T01:05:10.000Z","updated_at":"2021-03-19T06:25:02.000Z","dependencies_parsed_at":"2022-08-29T18:51:01.083Z","dependency_job_id":null,"html_url":"https://github.com/beanworks/React.withBackbone","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/beanworks%2FReact.withBackbone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanworks%2FReact.withBackbone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanworks%2FReact.withBackbone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beanworks%2FReact.withBackbone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beanworks","download_url":"https://codeload.github.com/beanworks/React.withBackbone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222465531,"owners_count":16989035,"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-07-31T22:00:37.615Z","updated_at":"2024-10-31T18:30:55.770Z","avatar_url":"https://github.com/beanworks.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# WithBackbone\n**React Higher Order Component which will bind Backbone Data that works with React Fiber (v.16)**\n\n[![NPM](https://nodei.co/npm/with-backbone.png)](https://nodei.co/npm/with-backbone/)\n\n\n[![Code Climate](https://codeclimate.com/github/beanworks/React.withBackbone/badges/gpa.svg)](https://codeclimate.com/github/beanworks/React.withBackbone)\n[![Test Coverage](https://codeclimate.com/github/beanworks/React.withBackbone/badges/coverage.svg)](https://codeclimate.com/github/beanworks/React.withBackbone/coverage)\n![CI Status](https://travis-ci.org/beanworks/React.withBackbone.svg?branch=master)\n\n## Why did we make it\nThere are already a couple of mixins or components that will link you Backbone model or collection with React, but with the introduction of [React Fiber (16.0)](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html), the `React.createClass` syntax will be deprecated which would suggest mixins are no longer a way to go, thus we've reinvented the wheel once again and created *withBackbone*.\n\n## How does it work\nThe [higher order component](https://facebook.github.io/react/docs/higher-order-components.html) will loop through the props you passed in, and for each of those props who are either backbone model or backbone collection, it will be listen to certain events and `forceUpdate` if the events are triggered. Here is a table that summerizes the events that will trigger a `forceUpdate`:\n\n| Backbone | Events |\n| --- | --- |\n| Model | Change|\n| Collection | Add, Remove, Sort, Reset|\n\n## To install \n``` npm install with-backbone```\n\n## To Use In Code\n```javascript\n   import withBackbone from 'withBackbone';\n   ...\n   \n   class TestClass extends React.Components {\n   \n    render () {\n        return something that renders a backbone model or collection in props, for example user\n     }\n   }\n   \n   TestClass.PropTypes = {\n      \"User\": PropTypes.instanceOf(Backbone.Model)\n   }\n   \n   export default withBackbone(TestClass);\n\n```\n\nNow when your user changes, the view component re-render.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeanworks%2FReact.withBackbone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeanworks%2FReact.withBackbone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeanworks%2FReact.withBackbone/lists"}