{"id":19785638,"url":"https://github.com/sharongrossman/redux-sockets","last_synced_at":"2025-04-30T23:30:49.850Z","repository":{"id":57351626,"uuid":"98096655","full_name":"SharonGrossman/redux-sockets","owner":"SharonGrossman","description":"Simplify the integration of socket.io with your Redux application","archived":false,"fork":false,"pushed_at":"2017-09-23T12:10:06.000Z","size":44,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T22:26:07.991Z","etag":null,"topics":["middleware","reducer","redux-socket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/SharonGrossman.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}},"created_at":"2017-07-23T12:33:43.000Z","updated_at":"2020-06-06T11:36:03.000Z","dependencies_parsed_at":"2022-09-19T00:02:06.832Z","dependency_job_id":null,"html_url":"https://github.com/SharonGrossman/redux-sockets","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonGrossman%2Fredux-sockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonGrossman%2Fredux-sockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonGrossman%2Fredux-sockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonGrossman%2Fredux-sockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SharonGrossman","download_url":"https://codeload.github.com/SharonGrossman/redux-sockets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224225072,"owners_count":17276436,"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":["middleware","reducer","redux-socket"],"created_at":"2024-11-12T06:15:18.212Z","updated_at":"2024-11-12T06:15:18.683Z","avatar_url":"https://github.com/SharonGrossman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-sockets ![BuildStatus](https://travis-ci.org/SharonGrossman/redux-sockets.svg?branch=master)\n\n## Install\n```\nnpm install --save-dev redux-sockets\n```\n\n## Description\n* A simple module to help simplify the integration of [socket.io](https://socket.io)\n with your [redux](http://redux.js.org/docs/introduction/) application\n* Emits client actions to the server if a `socket` payload is presented\n* Initializes socketio connection and handles connection actions to the server and client\n* Listens to any socket event using `socketio-wildcard`\nand dispatches the event to the client in the form of `server/ACTION_TYPE`\n\n## Usage\nThe module exports a middleware and a reducer\n\n### middleware\nAdd the middleware to the applyMiddleware function upon redux store initialization\n\n```\nimport socketIoMiddleware from 'redux-sockets';\n...\nreturn createStore(\n  ...\n  applyMiddleware(socketIoMiddleware(), ...middlewares)\n);\n```\n### reducer\nSimply import and add the reducer to your other reducers\n```\nimport {combineReducers} from 'redux';\nimport {reducer as socket} from 'redux-sockets';\n...\nexport default combineReducers({\n  ...\n  socket\n});\n```\n\nThe module also exports the action ``` socketConnect``` ,\nand action types ``` CONNECT, CONNECTED, DISCONNECTED```\n\n## Why not [redux-socket.io](https://github.com/itaylor/redux-socket.io)?\nredux-socket.io is great for capturing events from the server but I wanted more control\nover the received actions and create a connection on demand (emitting a CONNECT action)\nAlso, with redux-socket.io you could only capture a single event name. \nThis module captures all sorts of events.\n\n## License\n\n[MIT](LICENSE) © [Sharon Grossman](https://github.com/sharongrossman)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharongrossman%2Fredux-sockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharongrossman%2Fredux-sockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharongrossman%2Fredux-sockets/lists"}