{"id":13511359,"url":"https://github.com/wix-incubator/remx","last_synced_at":"2025-12-14T23:34:30.917Z","repository":{"id":11737452,"uuid":"70405458","full_name":"wix-incubator/remx","owner":"wix-incubator","description":"Opinionated mobx","archived":false,"fork":false,"pushed_at":"2025-02-19T11:19:00.000Z","size":1900,"stargazers_count":223,"open_issues_count":22,"forks_count":19,"subscribers_count":281,"default_branch":"master","last_synced_at":"2025-03-24T22:34:37.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wix-incubator.github.io/remx/","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/wix-incubator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-09T13:39:49.000Z","updated_at":"2025-01-31T07:47:03.000Z","dependencies_parsed_at":"2023-12-26T13:23:34.700Z","dependency_job_id":"4f233c69-e606-41c0-9ff4-5597fa3029e2","html_url":"https://github.com/wix-incubator/remx","commit_stats":{"total_commits":254,"total_committers":28,"mean_commits":9.071428571428571,"dds":0.5118110236220472,"last_synced_commit":"e623d93fbe632b614a64db67fb4814f293e12cb4"},"previous_names":["wix/remx","wix/remix"],"tags_count":1213,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2Fremx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2Fremx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2Fremx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wix-incubator%2Fremx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wix-incubator","download_url":"https://codeload.github.com/wix-incubator/remx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305476,"owners_count":20917197,"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-01T03:00:48.224Z","updated_at":"2025-12-14T23:34:25.884Z","avatar_url":"https://github.com/wix-incubator.png","language":"JavaScript","funding_links":[],"categories":["react"],"sub_categories":[],"readme":"[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://stand-with-ukraine.pp.ua)\n\n# remx [![Build Status](https://travis-ci.org/wix/remx.svg?branch=master)](https://travis-ci.org/wix/remx)\n\n### Remx is opinionated state-management library for React apps.\n\n_Website with getting started and docs: [https://wix.github.io/remx/](https://wix.github.io/remx/)_\n\n- Remx takes the redux (flux) architecture and enforces it using a small, simple, clean, and strict API:\n  - `state`\n  - `setters`\n  - `getters`\n  - `observe`\n  - `useConnect`\n- almost zero boilerplate\n- zero impact on tests\n  - can be added/removed as a plugin\n  - does not impact any design decisions\n- implemented with `mobx`, thus benefits from all the performance you get with\n  - memoization\n  - avoiding unnecessary re-renders\n- uses es6 Proxies (where possible)\n  - avoids mobx's Observable wrappers which can cause weird behaviour and bugs\n\n## Installation\n\n```\nnpm install remx\n```\n\n## API\n\n- Create state\n\n### `remx.state(initialState)`\n\n```javascript\nimport * as remx from \"remx\";\n\nconst initialState = {\n  loading: true,\n  posts: {},\n\n  selectedPosts: [],\n};\n\nconst state = remx.state(initialState);\n```\n\n- Define setters and getters\n\n### `remx.getters(...)`\n\n```javascript\nimport * as remx from \"remx\";\n\nconst setters = remx.setters({\n  setLoading(isLoading) {\n    state.loading = isLoading;\n  },\n\n  addPost(post) {\n    state.posts.push(post);\n  },\n});\n\nconst getters = remx.getters({\n  isLoading() {\n    return state.loading;\n  },\n\n  getPostsByIndex(index) {\n    return state.posts[index];\n  },\n});\n\nexport const store = {\n  ...setters,\n  ...getters,\n};\n```\n\n- Use observer to force a component to re-render if store data was used during previous render.\n\n### `remx.observer(MyComponent)`\n\n```javascript\nimport { observer } from \"remx\";\n\nclass SomeComponent extends React.Component {\n  render() {\n    return \u003cdiv\u003e{store.getPostById(this.props.selectedPostId)}\u003c/div\u003e;\n  }\n}\n\nexport default observer(SomeComponent);\n```\n\nAlso, works with functional components:\n\n```javascript\nimport { observer } from \"remx\";\n\nexport default observer((props) =\u003e (\n  \u003cdiv\u003e{store.getPostById(props.selectedPostId)}\u003c/div\u003e\n));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwix-incubator%2Fremx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwix-incubator%2Fremx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwix-incubator%2Fremx/lists"}