{"id":21108949,"url":"https://github.com/pajaydev/build-own-pubsub","last_synced_at":"2025-03-14T09:27:35.359Z","repository":{"id":35780273,"uuid":"204357709","full_name":"pajaydev/build-own-pubsub","owner":"pajaydev","description":"A simplified implementation to learn how to build our own pubsub (publisher-subscriber pattern)","archived":false,"fork":false,"pushed_at":"2023-01-04T23:39:51.000Z","size":227,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-20T19:45:33.687Z","etag":null,"topics":["build-pubsub","build-your-own-pubsub","event-emitter","learn-pubsub","listener","publisher","publisher-subscriber","publisher-subscriber-pattern","pubsub","topic","write-your-own-pubsub"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pajaydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-25T22:40:09.000Z","updated_at":"2023-03-04T05:22:44.000Z","dependencies_parsed_at":"2023-01-16T06:21:52.477Z","dependency_job_id":null,"html_url":"https://github.com/pajaydev/build-own-pubsub","commit_stats":null,"previous_names":["pajaydev/how-pubsub-works"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pajaydev%2Fbuild-own-pubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pajaydev%2Fbuild-own-pubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pajaydev%2Fbuild-own-pubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pajaydev%2Fbuild-own-pubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pajaydev","download_url":"https://codeload.github.com/pajaydev/build-own-pubsub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243538060,"owners_count":20307100,"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":["build-pubsub","build-your-own-pubsub","event-emitter","learn-pubsub","listener","publisher","publisher-subscriber","publisher-subscriber-pattern","pubsub","topic","write-your-own-pubsub"],"created_at":"2024-11-20T00:49:42.158Z","updated_at":"2025-03-14T09:27:35.301Z","avatar_url":"https://github.com/pajaydev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## build-pubsub\n\n\u003e A simplified implementation to learn how to build our own pubsub (publisher-subscriber pattern).\n\n\n### How do I learn?\nsource code: [build-pubsub]\n\n### Want to try \n\n```sh\n$ npm install build-pubsub\n```\n\n### how to use  \n```js\nconst Pubsub = require('build-pubsub');\nconst pubsub = new Pubsub();\npubsub.on('AJAX', ajaxFunc);\npubsub.on('AJAX', ajaxAnotherFunc);\npubsub.emit('AJAX', args); // fires both ajaxFunc \u0026 ajaxAnotherFunc with args\n```\n### Some of the useful links to learn pubsub.\n\n- [Publisher subscriber pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern)\n- [Observer vs pubsub pattern](https://hackernoon.com/observer-vs-pub-sub-pattern-50d3b27f838c)\n- [Enterprise integeration patterns](https://www.enterpriseintegrationpatterns.com/patterns/messaging/PublishSubscribeChannel.html)\n- [What is pubsub](https://blog.stackpath.com/pub-sub/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpajaydev%2Fbuild-own-pubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpajaydev%2Fbuild-own-pubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpajaydev%2Fbuild-own-pubsub/lists"}