Skip to content

Instantly share code, notes, and snippets.

@timdeschryver
Last active December 19, 2020 20:22
Show Gist options
  • Save timdeschryver/efdded8b72bd36ac0a2bc719eca1f161 to your computer and use it in GitHub Desktop.
Save timdeschryver/efdded8b72bd36ac0a2bc719eca1f161 to your computer and use it in GitHub Desktop.
ngrx-immer-migrate

ngrx-immer-migrate

Migrates the ngrx-etc immer functionallity to ngrx-immer. Do not forget to uninstall ngrx-etc and install ngrx-immer and immer3

#!/usr/bin/env node
require("replace-in-file").sync({
files: "**/*.ts",
ignore: "node_modules/**/*",
from: [/ngrx-etc/g, /mutableOn/g, /createMutableReducer/g],
to: ["ngrx-immer/store", "immerOn", "createImmerReducer"],
});
console.log("[ngrx-immer] Migration successfull, the last step is to uninstall `ngrx-etc` and to install `ngrx-immer` and `immer`:");
console.log("npm install ngrx-immer immer");
{
"name": "ngrx-immer-migrate",
"version": "1.0.0",
"bin": "./index.js",
"dependencies": {
"replace-in-file": "^6.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment