{"id":21515479,"url":"https://github.com/foblex/f-ng-infra","last_synced_at":"2025-04-09T20:12:09.664Z","repository":{"id":224624969,"uuid":"763778452","full_name":"Foblex/f-ng-infra","owner":"Foblex","description":"ngMediator is a mediator library for Angular that facilitates a clean architecture with a better command-query separation. It helps in orchestrating the handling of commands and queries in a simple, extendable, and maintainable manner.","archived":false,"fork":false,"pushed_at":"2024-03-23T12:18:23.000Z","size":132,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T20:12:04.381Z","etag":null,"topics":[],"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/Foblex.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":"2024-02-26T22:42:47.000Z","updated_at":"2024-08-10T15:11:53.000Z","dependencies_parsed_at":"2024-11-23T23:55:37.019Z","dependency_job_id":"16c33ae6-84a2-4cf5-baac-058dd4b4c544","html_url":"https://github.com/Foblex/f-ng-infra","commit_stats":null,"previous_names":["siarheihuzarevich/f-ng-infra","foblex/f-ng-infra"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foblex%2Ff-ng-infra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foblex%2Ff-ng-infra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foblex%2Ff-ng-infra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foblex%2Ff-ng-infra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foblex","download_url":"https://codeload.github.com/Foblex/f-ng-infra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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-11-23T23:55:29.387Z","updated_at":"2025-04-09T20:12:09.637Z","avatar_url":"https://github.com/Foblex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngMediator Library\n\nngMediator is a mediator library for Angular that facilitates a clean architecture with a better command-query separation. It helps in orchestrating the handling of commands and queries in a simple, extendable, and maintainable manner.\n\n## Installation\n\nInstall the ngMediator library via npm:\n\n```bash\nnpm install @foblex/ng-mediator\n```\n\n## Usage\n\nngMediator simplifies the handling of commands and queries within your Angular applications, ensuring a clean and maintainable architecture. Below are the steps on how to utilize ngMediator in your project:\n\n1. **Define Requests, Validators, and Handlers**:\n   Define your requests, validators, and handlers using the provided decorators and interfaces from the ngMediator library.\n\n   Example:\n   ```typescript\n   import { IRequest, FValidatorBase, FCommandBase, FQueryBase } from '@foblex/ng-mediator';\n   \n   // Define your Request\n   class MyRequest implements IRequest\u003cMyResponse\u003e { }\n   \n    // Define your Response\n   class MyResponse { \n    // fields...\n   }\n\n   // Define your Validator\n   @Injectable()\n   class MyValidator extends FValidatorBase\u003cMyRequest, MyResponse\u003e {\n     validate(request: MyRequest): Observable\u003cError[]\u003e {\n       // validation logic...\n     }\n   }\n   \n   // Define your Handler\n   @Injectable()\n   class MyHandler extends FCommandBase\u003cMyRequest, MyResponse\u003e {\n     handle(request: MyRequest): Observable\u003cMyResponse\u003e {\n       // handling logic...\n     }\n   }\n   // or\n   @Injectable()\n   class MyHandler extends FQueryBase\u003cMyRequest, MyResponse\u003e {\n     handle(request: MyRequest): Observable\u003cMyResponse\u003e {\n       // handling logic...\n     }\n   }\n   \n   @NgModule({\n      imports: [\n        FMediatorModule.forFeature(MyRequest, MyValidator, MyHandler),\n      ]\n   })\n   export class Module { }\n    ```\n2. **Send Requests**:\n\n   Utilize the FMediator service to send your requests. The service will ensure that your requests are validated and handled by the appropriate handlers.\n\n   Example:\n    ```typescript\n    import { FMediator } from '@foblex/ng-mediator';\n\n    fMediator.send(new MyRequest()).subscribe(response =\u003e {\n        console.log(response);\n    });\n    ```\n\n\n# ngClarc Library\n\nngClarc is infrastructure library for Angular that provides a robust set of utilities and interfaces designed to simplify and enhance various projects.\n\n## Installation\n\nInstall the ngClarc library via npm:\n\n```bash\nnpm install @foblex/ng-clarc \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoblex%2Ff-ng-infra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoblex%2Ff-ng-infra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoblex%2Ff-ng-infra/lists"}