{"id":15013434,"url":"https://github.com/lh0x00/hypersubs","last_synced_at":"2025-09-03T23:39:49.585Z","repository":{"id":118761922,"uuid":"161635472","full_name":"lh0x00/hypersubs","owner":"lh0x00","description":"an upgraded version of Meteor subscribe, which helps optimize data and performance!","archived":false,"fork":false,"pushed_at":"2021-10-10T07:46:41.000Z","size":23,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T00:13:02.693Z","etag":null,"topics":["ddp","ddp-client","hacks","meteor","meteor-package","meteorjs","publications","subscribe","subscriptions"],"latest_commit_sha":null,"homepage":"https://atmospherejs.com/lamhieu/hypersubs","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/lh0x00.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-12-13T12:23:40.000Z","updated_at":"2024-02-21T15:56:03.000Z","dependencies_parsed_at":"2023-11-07T04:16:14.091Z","dependency_job_id":null,"html_url":"https://github.com/lh0x00/hypersubs","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":0.06666666666666665,"last_synced_commit":"b373187bbc2fc592b063af2537fc21b3b5614021"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lh0x00%2Fhypersubs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lh0x00%2Fhypersubs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lh0x00%2Fhypersubs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lh0x00%2Fhypersubs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lh0x00","download_url":"https://codeload.github.com/lh0x00/hypersubs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519468,"owners_count":21117757,"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":["ddp","ddp-client","hacks","meteor","meteor-package","meteorjs","publications","subscribe","subscriptions"],"created_at":"2024-09-24T19:44:16.461Z","updated_at":"2025-04-12T04:44:16.017Z","avatar_url":"https://github.com/lh0x00.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hypersubs\n\n[![github issues][github-issues-image]][github-issues-url]\n[![build status][travis-image]][github-project-url]\n\nAn upgraded version of Meteor subscribe, which helps optimize data and performance!\n\n## Why hypersubs?\n\nThis is the overwritten version of **Meteor subscribe**. It optimizes performance by not create connect sent to the server when it is not needed.\n**Hypersubs** only creates one connection for multiple subscriptions when detected it is duplicate (same publication name and params). **Hypersubs** only make a real connection (for the first time call `Meteor.subscribe`), since the second times call `Meteor.subscribe`, they will be optimized reuse the connection is existed!\n\n## Installation\n\nread more in [atmospherejs](https://atmospherejs.com/lamhieu/hypersubs)\n\n```bash\n$ meteor add lamhieu:hypersubs\n```\n\nAll the rest of the packages are automatically made for you, no need to change anything in your source code!\n\n[github-project-url]: https://github.com/lamhieu-vk/hypersubs\n[travis-image]: https://travis-ci.com/lamhieu-vk/hypersubs.svg?branch=master\n[github-issues-image]: https://img.shields.io/github/issues/lamhieu-vk/hypersubs.svg\n[github-issues-url]: https://github.com/lamhieu-vk/hypersubs/issues\n\n\n## How it work?\n\nOn the page, every time you call `Meteor.subscribe`, the system will create a` subscription` and start its workflow, it will send the request to the server, and get back in the message returned from the server. When you call `Meteor.subscribe` with the same arguments and names in multiple locations, the system creates separate connections, so there is a need for unnecessary connections!\n\n### For example:\n\n#### default\n\nAt element A, we call `Meteor.subscribe('getData', '_id')` and somewhere in the page (many other elements) also call `Meteor.subscribe('getData', '_id')` each time you call to it the system thing will create a server communication connection! **things are not re-used!**\n\n#### with hpersubs\n\nAt immortality A, we call `Meteor.subscribe('getData', '_id')` and somewhere in the page, even if you recall something like that, we only created one communication line with the server. and it is re-used! **The server you are working less, the speed of subscribe feedback is returned immediately!**\n\n\n### Options\n\nDefault options:\n```javascript\nconst options = {\n  isOverride: true, // is override original Meteor.subscribe\n}\n```\n\n#### How to config options?\n\nDefault, you can use **hypersubs** without config but you want custom config you can do this\n\n```javascript\nimport { config } from 'meteor/lamhieu:hypersubs';\n\n// if you don't want override original Meteor.subscribe\nconfig.isOverride = false;\n```\n\n### Usage\n\n#### Meteor\n\nDefault **hypersubs** is add to Meteor variable, you can use by call `Meteor.hyperSubscribe` like `Meteor.subscribe`!\n\nIf set `isOverride: true` you don't need change any code in your source because `Meteor.subscribe` will replace by `Meteor.hyperSubscribe`, and you can call original susbcribe by call `Meteor.originalSubscribe`\n\nIf set `isOverride: false` when you want use **hypersubs** you need call `Meteor.hyperSubscribe`\n\n#### DDP\n\nDefault when if set `isOverride: true` when you call `DDP.connect(url)` to create new connection, it will return a connection wrapped by **hypersubs** (called by `hyperConnection`), `DD.subscribe` inside `DDP` is a `hyperSusbcribe`.\n\n#### Check\n\nTo check a connection is wrapped by **hypersubs**\n```javascript\n// DDP\nconst ddp = DDP.connect(url);\nif (ddp.isHyperConnection) {\n  // is hyperConnection\n}\n\n// Meteor\nconst subscribe = Meteor.subscribe; // or DDP.subscribe\nif (subscribe.isHyperSubscribe) {\n  // is hyperSubscribe\n}\n\n// Handle\nconst handle = Meteor.subscribe('publicationName', 'test'); // or\nconst handle = Meteor.hyperSubscribe('publicationName', 'test');\nif (handle.isHyperHandle) {\n  // is hyperHandle\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flh0x00%2Fhypersubs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flh0x00%2Fhypersubs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flh0x00%2Fhypersubs/lists"}