{"id":20532669,"url":"https://github.com/devmapal/ng2-django-channels-demultiplexing","last_synced_at":"2025-04-14T06:32:29.341Z","repository":{"id":72379002,"uuid":"79843832","full_name":"devmapal/ng2-django-channels-demultiplexing","owner":"devmapal","description":null,"archived":false,"fork":false,"pushed_at":"2017-03-29T16:01:05.000Z","size":4,"stargazers_count":4,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-24T10:05:21.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devmapal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-01-23T20:17:10.000Z","updated_at":"2019-02-21T19:31:54.000Z","dependencies_parsed_at":"2023-05-22T17:45:31.878Z","dependency_job_id":null,"html_url":"https://github.com/devmapal/ng2-django-channels-demultiplexing","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"87a26ba066e8d88daf01f6b82baed76f764fe488"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmapal%2Fng2-django-channels-demultiplexing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmapal%2Fng2-django-channels-demultiplexing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmapal%2Fng2-django-channels-demultiplexing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmapal%2Fng2-django-channels-demultiplexing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devmapal","download_url":"https://codeload.github.com/devmapal/ng2-django-channels-demultiplexing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248833934,"owners_count":21168932,"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-16T00:16:22.271Z","updated_at":"2025-04-14T06:32:29.312Z","avatar_url":"https://github.com/devmapal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng2-django-channels-demultiplexing\n\n## Installation\n\nTo install this library, run:\n\n```bash\n$ npm install ng2-django-channels-demultiplexing --save\n```\n\n## Usage\n\nSample Angular `AppModule`:\n\n```typescript\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { AppComponent } from './app.component';\n\n// Import library\nimport { Ng2DjangoChannelsDemultiplexingModule } from 'ng2-django-channels-demultiplexing';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n\n    // Specify library as an import and configure the WebSocket URL\n    Ng2DjangoChannelsDemultiplexingModule.forRoot({websocket_url: 'ws://127.0.0.1:8001/api/ws'})\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\n\nOnce imported, you can use WebSocketDemultiplexingService in your Angular application:\n\n```typescript\nimport { Injectable } from '@angular/core';\nimport { Demultiplexing, WebSocketDemultiplexingService } from 'ng2-django-channels-demultiplexing';\n\n@Injectable()\nexport class SomeService {\n  constructor(private webSocketDemultiplexerService: WebSocketDemultiplexerService) {\n    this.webSocketDemultiplexerService.subscribe('some_stream', (payload: Object) =\u003e {\n      ...\n    });\n  }\n\n  sendData(stream: string, data: Object): void {\n    this.webSocketDemultiplexerService.sendData(\n      stream,\n\t  data\n    );\n  }\n}\n```\n\n## License\n\nMIT © [Fabian Schaffert](mailto:fabian@schaffert.cc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmapal%2Fng2-django-channels-demultiplexing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmapal%2Fng2-django-channels-demultiplexing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmapal%2Fng2-django-channels-demultiplexing/lists"}