{"id":15354032,"url":"https://github.com/riron/effects-mapper","last_synced_at":"2025-04-15T06:01:23.257Z","repository":{"id":72721308,"uuid":"111944302","full_name":"Riron/effects-mapper","owner":"Riron","description":"📑 Effects mapper for @ngrx/effects","archived":false,"fork":false,"pushed_at":"2017-12-22T14:50:51.000Z","size":158,"stargazers_count":28,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T16:42:48.211Z","etag":null,"topics":["angular","mapper","ngrx","reactive","rxjs","static-code-analysis","typescript","visualizer"],"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/Riron.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":"2017-11-24T17:59:41.000Z","updated_at":"2024-01-04T19:01:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f16fc2eb-2765-4da3-8741-0f3ae6bd7c9c","html_url":"https://github.com/Riron/effects-mapper","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"80bf754e42099490f17e4b99f3752412e89c4afc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riron%2Feffects-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riron%2Feffects-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riron%2Feffects-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riron%2Feffects-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Riron","download_url":"https://codeload.github.com/Riron/effects-mapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016625,"owners_count":21198832,"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":["angular","mapper","ngrx","reactive","rxjs","static-code-analysis","typescript","visualizer"],"created_at":"2024-10-01T12:16:46.754Z","updated_at":"2025-04-15T06:01:23.164Z","avatar_url":"https://github.com/Riron.png","language":"TypeScript","readme":"# Effects Mapper\n\nUsing `@ngrx/effects` ? Ever had trouble following the flow of effects in your\napp ? Easily generate a map of whats action causes what.\n\n## 📦 Installation \u0026 Usage\n\nTo install this application, you'll need\n[Node.js](https://nodejs.org/en/download/) 8+ (which comes with\n[npm](http://npmjs.com)) installed on your computer. You'll also need [Git](https://git-scm.com) to run the project from source:\n\n```bash\n# Clone this repository\n$ git clone https://github.com/Riron/effects-mapper\n\n# Go into the repository\n$ cd effects-mapper\n\n# Install dependencies\n$ npm install\n\n# Run the app on an entire folder\n$ npm run console ./demo\n# Or on individual files\n$ npm run console ./file1.ts ./file2.ts\n```\n\nYou can print the result either to the console or to a JSON file. With the JSON file, you can then use the browser UI (see below) and visualize you effects as trees.\n\n```bash\n# Use the console output\n$ npm run console ./demo\n\n# Use the JSON output (for browser UI)\n$ npm run json ./demo\n```\n\n![Console output example](images/console-ui.png)\n\n## 🔮 Browser UI\n\nIf you chose to generate a JSON file, you can then visualize the result in the browser.\n\n```bash\n# Move the created \"tree-xxxxx.json\" file to the \"./client\" directory and rename it as \"trees.json\"\n$ mv tree-xxxxx.json ./client/trees.json\n\n# Open the browser UI\n$ npm run browser\n```\n\n![Browser UI output example](images/browser-ui.png)\n\n## 🔬 How does it work ?\n\nThis tool statically analyze your code. It uses the Typescript compiler\nto grab all properties decorated with the `@Effect()` decorator and then perform its magic on the `ofType()` call for the input, and the returning call for the output.\n\n## 💣 Edges cases\n\nSome edge cases are not fully supported yet. If the library is not able to\ndetermine the return type of an effect, it will consider the return type is\nnull.\n\nExample of unhandled cases:\n\n```typescript\n// If the type\n@Effect() effect = this.ofType('A_TYPE')\n\t.map(action =\u003e { type: action.type })\n\n// if you reference imports that are not part of the analysis, it won't be possible to guess the action type\nimport { AnAction } from 'unloadedNpmModule'\n@Effect() effect = this.ofType('A_TYPE')\n\t.map(_ =\u003e AnAction)\n```\n\nAnd probably others... As people use the library, more and more cases\nwill be implemented. Feel free to create an issue if one of your effects is not\nhandled properly !\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friron%2Feffects-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friron%2Feffects-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friron%2Feffects-mapper/lists"}