{"id":13525355,"url":"https://github.com/tkh44/shallow-compare","last_synced_at":"2025-03-17T02:31:45.443Z","repository":{"id":57357846,"uuid":"72120852","full_name":"tkh44/shallow-compare","owner":"tkh44","description":"Stand alone shallowCompare for use in libraries that support shouldComponentUpdate","archived":false,"fork":false,"pushed_at":"2017-09-28T19:36:20.000Z","size":12,"stargazers_count":34,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T16:55:54.108Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkh44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-27T15:16:02.000Z","updated_at":"2023-07-25T03:37:31.000Z","dependencies_parsed_at":"2022-09-26T16:33:14.745Z","dependency_job_id":null,"html_url":"https://github.com/tkh44/shallow-compare","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Fshallow-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Fshallow-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Fshallow-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Fshallow-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkh44","download_url":"https://codeload.github.com/tkh44/shallow-compare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841125,"owners_count":20356440,"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-08-01T06:01:17.969Z","updated_at":"2025-03-17T02:31:45.165Z","avatar_url":"https://github.com/tkh44.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# shallow-compare\n\n[![npm version](https://badge.fury.io/js/shallow-compare.svg)](https://badge.fury.io/js/shallow-compare)\n\nStand alone shallowCompare for use in libraries that support shouldComponentUpdate\n\n## API\n\n`shallowCompare(instance, nextProps, nextState)`\n\n - instance (_component instance_) - the component's instance (`this`)\n - nextProps (_object_) - the next props\n - nextState (_object_) - the next state\n \n## Example\n```javascript\nclass Foo extends Component {\n  constructor (props) {\n    super(props);\n    this.state = { color: 'blue' }\n  }\n\n  shouldComponentUpdate (nextProps, nextState) {\n    return shallowCompare(this, nextProps, nextState)\n  }\n\n  render () {\n    return (\n      \u003cdiv\u003e{this.state.color}\u003c/div\u003e\n    )\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkh44%2Fshallow-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkh44%2Fshallow-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkh44%2Fshallow-compare/lists"}