{"id":18185041,"url":"https://github.com/jaandrle/fpubsub","last_synced_at":"2026-05-01T03:31:12.298Z","repository":{"id":65170218,"uuid":"584797519","full_name":"jaandrle/fpubsub","owner":"jaandrle","description":"PubSub pattern library with types support","archived":false,"fork":false,"pushed_at":"2023-01-25T11:55:47.000Z","size":102,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T20:08:28.373Z","etag":null,"topics":["event","event-emitter","functional-programming","javascript","pub-sub","pubsub","reactive","reactive-programming","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fpubsub","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/jaandrle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-03T14:42:02.000Z","updated_at":"2023-01-09T09:54:24.000Z","dependencies_parsed_at":"2023-02-14T06:45:46.661Z","dependency_job_id":null,"html_url":"https://github.com/jaandrle/fpubsub","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jaandrle/fpubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaandrle%2Ffpubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaandrle%2Ffpubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaandrle%2Ffpubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaandrle%2Ffpubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaandrle","download_url":"https://codeload.github.com/jaandrle/fpubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaandrle%2Ffpubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32484352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["event","event-emitter","functional-programming","javascript","pub-sub","pubsub","reactive","reactive-programming","typescript"],"created_at":"2024-11-02T22:05:47.492Z","updated_at":"2026-05-01T03:31:12.282Z","avatar_url":"https://github.com/jaandrle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fpubsub – PubSub implementation\nThis is the JavaScript implementation of the **PubSub** pattern in *JavaScript* for beeing used in functional programming approach.\n\n```js\n/** @type {fpubsubTopic\u003cstring\u003e} */\nconst onexample= topic();\nsubscribe(onexample, console.log);\nsubscribe(onexample)(console.log);\nsubscribe(console.log)(onexample);\n\npublish(onexample, \"Publish info to `onexample` topic.\");\npublish.bind(null, onexample)(\"Publish info to `onexample` again.\");\npublish(\"Publish info to `onexample` last time.\")(onexample);\n```\n\n## Quick links\n- Examples: see folder [./examples](./examples)\n- [Guide](#guide)\n- [Documentation](./docs/README.md) (generated from TypeScript)\n\n## Guide\nSee [Publish–subscribe pattern - Wikipedia](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) to more information about PubSub pattern.\n\nYou can use library as regular npm package.\n```bash\nnpm install fpubsub --save\n```\n```js\nimport { topic, subscribe, publish } from \"fpubsub\";\n/** @type {fpubsubTopic\u003cstring\u003e} */\nconst onexample= topic();\nsubscribe(onexample, console.log);\npublish(onexample, \"Publish info to `onexample` topic.\");\n```\n\nLibrary exports:\n- functions:\n\t- [`topic`](./docs/README.md#topic): to generate event/topic\n\t\t- you can also use with options `{ once, cache, initial, mapper }`, see [in docs](./docs/README.md#topicoptions)\n\t\t- `topicFrom` – see [#7](https://github.com/jaandrle/fpubsub/issues/7)\n\t- [`subscribe`](./docs/README.md#subscribe) (alias: `sub`): to subscribe topics\n\t- [`publish`](./docs/README.md#publish) (alias: `pub`): to publish messages to the given topic\n\t- [`unsubscribe`](./docs/README.md#unsubscribe) (alias: `unsub`): to remove topics listeners\n\t- another helpers: `unsubscribeAll`, `has`, `erase`, `isTopic`, `valueOf`\n- types:\n\t- `Topic`: to anote you TypeScript topic\n\t- or `fpubsubTopic`: as global type for anotating topics in JavaScript (JSDoc)\n\n…see [Documentation (generated from TypeScript)](./docs/README.md)\n\n## See also\n- [yamiteru/ueve: 🔥 Hellishly fast and 🤏 tiny async/sync event emitter](https://github.com/yamiteru/ueve)\n- [pubsub - npm search](https://www.npmjs.com/search?q=pubsub)\n- [emit - npm search](https://www.npmjs.com/search?q=emit)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaandrle%2Ffpubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaandrle%2Ffpubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaandrle%2Ffpubsub/lists"}