{"id":23135661,"url":"https://github.com/viewstools/dealing-with-global-app-state","last_synced_at":"2025-04-04T08:24:18.794Z","repository":{"id":84374041,"uuid":"121879244","full_name":"viewstools/dealing-with-global-app-state","owner":"viewstools","description":"Some ways of dealing with global state and passing less props down your components","archived":false,"fork":false,"pushed_at":"2018-02-18T10:59:41.000Z","size":131,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T19:35:32.162Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viewstools.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":"2018-02-17T18:07:42.000Z","updated_at":"2018-04-02T13:48:25.000Z","dependencies_parsed_at":"2023-07-07T01:15:33.741Z","dependency_job_id":null,"html_url":"https://github.com/viewstools/dealing-with-global-app-state","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/viewstools%2Fdealing-with-global-app-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viewstools%2Fdealing-with-global-app-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viewstools%2Fdealing-with-global-app-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viewstools%2Fdealing-with-global-app-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viewstools","download_url":"https://codeload.github.com/viewstools/dealing-with-global-app-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247143780,"owners_count":20891006,"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-12-17T12:16:19.385Z","updated_at":"2025-04-04T08:24:18.784Z","avatar_url":"https://github.com/viewstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Some ways of dealing with (global) application state and passing less props down your components\n\n[Here's a little video](https://youtu.be/kUT0crvNhoA) where we explore how we can share\nstate that belongs to more than one component and maybe even the whole app.\n\n- The simplest is to just use React's state and pass props around, you can see how that's\n   done [here](https://github.com/viewstools/dealing-with-global-app-state/commit/7ed532750053c6d157bedd159e9099aaaa8aa937).\n\n- That can get a bit messy when your app grows, so then, many people choose something like [Redux](https://redux.js.org).\n[See the refactored code here](https://github.com/viewstools/dealing-with-global-app-state/commit/ee1d1e00643e3fbb46267874d424881755f53bfa).\n\n- As we understand more about how to structure React applications, the community is coming up\nwith new ways of doing this like [unstated](https://github.com/jamiebuilds/unstated), a\n   new library that uses a Subscriber/Consumer abstraction based off React's\n   [new context API](https://github.com/reactjs/rfcs/pull/2). [See it here](https://github.com/viewstools/dealing-with-global-app-state/commit/3d49d77ce306a17354dee89e40143ab9174cb370).\n\nBy the way, if the structure of your app remains flat, just use state and pass a\nprop! If it grows, then maybe consider 2 and 3 :).\n\nHow do you manage global state in your apps?\n\nCurious about what that `.view` file is? Check out https://docs.views.tools ;).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviewstools%2Fdealing-with-global-app-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviewstools%2Fdealing-with-global-app-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviewstools%2Fdealing-with-global-app-state/lists"}