{"id":19915626,"url":"https://github.com/brugarolas/immersible","last_synced_at":"2026-06-10T00:31:25.198Z","repository":{"id":148387566,"uuid":"619315834","full_name":"Brugarolas/immersible","owner":"Brugarolas","description":"My own version of Immer. Just for fun!","archived":false,"fork":false,"pushed_at":"2023-04-14T16:56:45.000Z","size":42,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T04:09:54.314Z","etag":null,"topics":["copy-on-write","immer","immutability","immutable","immutables","javascript","proxy","state-tree"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brugarolas.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-26T21:48:46.000Z","updated_at":"2023-03-30T17:27:19.000Z","dependencies_parsed_at":"2023-05-19T23:30:41.476Z","dependency_job_id":null,"html_url":"https://github.com/Brugarolas/immersible","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/Brugarolas%2Fimmersible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brugarolas%2Fimmersible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brugarolas%2Fimmersible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brugarolas%2Fimmersible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brugarolas","download_url":"https://codeload.github.com/Brugarolas/immersible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241343511,"owners_count":19947398,"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":["copy-on-write","immer","immutability","immutable","immutables","javascript","proxy","state-tree"],"created_at":"2024-11-12T21:41:30.489Z","updated_at":"2026-06-10T00:31:25.191Z","avatar_url":"https://github.com/Brugarolas.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/brugarolas"],"categories":[],"sub_categories":[],"readme":"[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/brugarolas)\n\n# Immersible\nImmersible is my own version of Immer. It is more restrictive and has, in my opinion, a more convenient API. You can also subscribe to changes with my library.\n\n## Installation\nFirst, we need to install `immersible`:\n\n```bash\nnpm install --save immersible\n```\n\nAnd then we import `immersible` where we want to use it.\n\n```js\nimport { Immersible } from 'immersible'\n```\n\n## Usage\n\nUsage is quite simple:\n\n```js\nconst todo = new Immersible([\n    {\n        title: \"Learn TypeScript\",\n        done: true\n    },\n    {\n        title: \"Try Immer\",\n        done: false\n    }\n]);\n\ntodo.produce((draft) =\u003e {\n  draft[1] = true\n  draft.push({ title: \"Tweet about it\", done: false })\n})\n```\n\nWe can access baseState or, if mutated, nextState way simple:\n```js\nconsole.log(todo.state)\n```\n\nDifferently than with `Immer`, we can set `setAutoFreeze` and `setUseStrictShallowCopy` by object, and not globally:\n```js\ntodo.setAutoFreeze(false)\ntodo.setAutoFreeze(true)\n```\n\nWe can also subscribe/unsubscribe to changes:\n```js\nconst subscriptionId = todo.subscribe((nextState) =\u003e\n  console.log(nextState)\n);\n\ntodo.produce((draft) =\u003e {\n  draft[2] = true\n})\n\ntodo.unsubscribe(subscriptionId)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrugarolas%2Fimmersible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrugarolas%2Fimmersible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrugarolas%2Fimmersible/lists"}