{"id":23741294,"url":"https://github.com/neocoast/neox","last_synced_at":"2025-09-04T15:33:08.488Z","repository":{"id":40753998,"uuid":"268882306","full_name":"NeoCoast/Neox","owner":"NeoCoast","description":"Alternative of ImmutableJS that works smoothly with Redux hooks","archived":false,"fork":false,"pushed_at":"2023-01-06T14:00:45.000Z","size":341,"stargazers_count":15,"open_issues_count":13,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T16:34:38.043Z","etag":null,"topics":["immutablejs","npm","react","redux","redux-hooks"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/NeoCoast.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":"2020-06-02T18:47:58.000Z","updated_at":"2022-09-15T00:34:39.000Z","dependencies_parsed_at":"2023-02-06T04:46:16.396Z","dependency_job_id":null,"html_url":"https://github.com/NeoCoast/Neox","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/NeoCoast%2FNeox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoCoast%2FNeox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoCoast%2FNeox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoCoast%2FNeox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeoCoast","download_url":"https://codeload.github.com/NeoCoast/Neox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231971821,"owners_count":18454051,"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":["immutablejs","npm","react","redux","redux-hooks"],"created_at":"2024-12-31T10:19:39.448Z","updated_at":"2024-12-31T10:19:41.000Z","avatar_url":"https://github.com/NeoCoast.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/NeoCoast/neox\" target=\"_blank\"\u003e\n    \u003cimg width=\"250px\" src=\"https://raw.githubusercontent.com/NeoCoast/neox/master/static/logo.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@neocoast/neox\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@neocoast/neox.svg\"/\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/@neocoast/neox.svg\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Neox\n\n## Installation\n\n```bash\nnpm install --save @neocoast/neox \nor\nyarn add @neocoast/neox\n```\n\n\n## Usage\n\n```js\nimport fromJS from '@neocoast/neox';\n\nconst state = fromJS({\n  loading: false,\n  username: null,\n});\n\nconsole.log(intialState);\n// {values: Map(2), toJS: ƒ, set: ƒ}\n\nconsole.log(state.values);\n// Map(2) {\"loading\" =\u003e false, \"username\" =\u003e null}\n\nconsole.log(state.toJS());\n// {loading: false, username: null}\n\n// Change username\nstate.set('username', 'tintef');\n\nconsole.log(state.toJS());\n// {loading: false, username: 'tintef'}\n\n\n// Chained set calls\nstate.set('username', 'maurocen').set('loading', true);\n\nconsole.log(state.toJS());\n// {loading: false, username: 'maurocen'}\n```\n\n### Usage with redux-devtools\n\nIn order to correctly see your reducers chart in Redux's devtools, the following needs to be done:\n\n```js\nconst devToolsExtension = window.__REDUX_DEVTOOLS_EXTENSION__ ? (\n  window.__REDUX_DEVTOOLS_EXTENSION__({\n    serialize: {\n      replacer: (key, value) =\u003e value \u0026\u0026 value.toJS ? value.toJS() : value\n    },\n  })\n) : (\n  (f) =\u003e f\n);\n```\n\n\n## Motivation\n\n[ImmutableJS](https://immutable-js.github.io/immutable-js/) doesn't work well with [Redux's hooks](https://react-redux.js.org/api/hooks) -- see [this issue](https://github.com/reduxjs/redux/issues/3699).\n\nNeox doesn't change the values references inside the object retrieved by the `toJS()` method and this allows the following comparisson:\n\n```js\nconst state = fromJS({ arr: ['tintef', 'maurocen'] });\n\nconsole.log(state.toJS().arr === state.toJS().arr);\n// true\n```\n\nIf you're currently using `Immutable`, an effect triggered by changes on `state.toJS().arr` will be triggered even when `arr`hasn't changed at all. This is because `Immutable`'s `toJS()` function changes the references of the internal values. `Neox` doesn't change the internal references unless `.set` is called. So your effect will only be triggered when you set a new array to it.\n\n\n\u003cp align=\"center\" style=\"font-size: 10px; margin-top: 50px;\"\u003e\nIcons made by \u003ca href=“https://www.flaticon.es/autores/freepik” title=“Freepik”\u003eFreepik\u003c/a\u003e from \u003ca href=“https://www.flaticon.es/” title=“Flaticon”\u003e www.flaticon.es\u003c/a\u003e\n\u003cp align=\"center\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocoast%2Fneox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneocoast%2Fneox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocoast%2Fneox/lists"}