{"id":17349206,"url":"https://github.com/co2-git/trunks","last_synced_at":"2025-03-27T11:44:20.242Z","repository":{"id":57380336,"uuid":"62677888","full_name":"co2-git/trunks","owner":"co2-git","description":"Minimalistic Flux stores for React","archived":false,"fork":false,"pushed_at":"2016-09-27T19:15:31.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T08:48:42.346Z","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/co2-git.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":"2016-07-06T00:12:45.000Z","updated_at":"2016-07-06T00:14:31.000Z","dependencies_parsed_at":"2022-08-28T22:01:58.124Z","dependency_job_id":null,"html_url":"https://github.com/co2-git/trunks","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Ftrunks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Ftrunks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Ftrunks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Ftrunks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/co2-git","download_url":"https://codeload.github.com/co2-git/trunks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841689,"owners_count":20681184,"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-15T16:55:02.622Z","updated_at":"2025-03-27T11:44:20.212Z","avatar_url":"https://github.com/co2-git.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"trunks\n===\n\nMinimalistic stores for React.\n\n# Usage\n\nCreate a store:\n\n```javascript\n// counter.js\nimport Trunk from 'trunks';\n\nexport default class MyTrunk extends Trunk {\n  // declare your store here\n  static store = Trunk.map({\n    clicked: 0,\n  });\n\n  click() {\n    this.set({clicked: this.get('store') + 1});\n  }\n}\n```\n\nIn your view:\n\n```javascript\nimport React, {Component} from 'react';\nimport {connect} from 'trunks';\nimport Counter from './Counter';\n\nclass ClickCounter extends Component {\n  render() {\n    const {Counter: CounterStore} = this.props.trunks.stores;\n    const {Counter: CounterActions} = this.props.trunks.actions;\n    return (\n      \u003cbutton onClick={() =\u003e CounterActions.click()}\u003e\n        This button has been clicked {CounterStore.clicked} times\n      \u003c/button\u003e\n    );\n  }\n}\n\n// Don't forget to connect your component!\n// You can listen to more than one store\nexport default connect(ClickCounter, {Counter});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco2-git%2Ftrunks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fco2-git%2Ftrunks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco2-git%2Ftrunks/lists"}