{"id":18868039,"url":"https://github.com/connect-platform/connective","last_synced_at":"2025-08-20T12:31:12.110Z","repository":{"id":35021542,"uuid":"191344258","full_name":"CONNECT-platform/connective","owner":"CONNECT-platform","description":"agent-based reactive programming library for typescript","archived":false,"fork":false,"pushed_at":"2023-03-04T03:54:14.000Z","size":1566,"stargazers_count":100,"open_issues_count":10,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-09T00:54:42.669Z","etag":null,"topics":["agent-based","architecture","data-flow","framework","javascript","reactive","rxjs","typescript"],"latest_commit_sha":null,"homepage":"https://connective.dev","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/CONNECT-platform.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-11T10:00:06.000Z","updated_at":"2024-11-05T08:43:00.000Z","dependencies_parsed_at":"2024-06-19T05:36:37.763Z","dependency_job_id":null,"html_url":"https://github.com/CONNECT-platform/connective","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CONNECT-platform%2Fconnective","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CONNECT-platform%2Fconnective/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CONNECT-platform%2Fconnective/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CONNECT-platform%2Fconnective/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CONNECT-platform","download_url":"https://codeload.github.com/CONNECT-platform/connective/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230423559,"owners_count":18223435,"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":["agent-based","architecture","data-flow","framework","javascript","reactive","rxjs","typescript"],"created_at":"2024-11-08T05:12:33.509Z","updated_at":"2024-12-19T11:11:57.649Z","avatar_url":"https://github.com/CONNECT-platform.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/CONNECT-platform/connective/master/logo.svg?sanitize=true\" width=\"320px\"/\u003e\n\u003c/p\u003e\n\n```\nnpm i @connectv/core\n```\n\n[![Minzipped size](https://badgen.net/bundlephobia/minzip/@connectv/core@latest)](https://bundlephobia.com/result?p=@connectv/core@latest)\n[![Build Status](https://travis-ci.org/CONNECT-platform/connective.svg?branch=master)](https://travis-ci.org/CONNECT-platform/connective)\n[![CodeFactor](https://www.codefactor.io/repository/github/connect-platform/connective/badge)](https://www.codefactor.io/repository/github/connect-platform/connective)\n[![Chat on Gitter](https://img.shields.io/gitter/room/connectv/community)](https://gitter.im/connectv/community)\n\u003cbr\u003e\n\n**CONNECTIVE** facilitates large-scale [reactive programming](https://en.wikipedia.org/wiki/Reactive_programming) in Type(Java)Script. It enables declarative creation of large and complex data/event flows and supports re-use of flows.\n\nExample ([Stackblitz](https://stackblitz.com/edit/connective-hellow-world)):\n\n```typescript\nimport { wrap, map, filter } from '@connectv/core';\nimport { fromEvent } from 'rxjs';\n\nlet a = document.getElementById('a') as HTMLInputElement;\nlet p = document.getElementById('p');\n\n//\n// Will say hello to everyone but 'Donald'.\n// For obvious reasons.\n//\n\nwrap(fromEvent(a, 'input'))           // --\u003e wrap the `Observable` in a `Pin`\n.to(map(() =\u003e a.value))               // --\u003e map the event to value of the input\n.to(filter(name =\u003e name != 'Donald')) // --\u003e filter 'Donald' out\n.to(map(name =\u003e 'hellow ' + name))    // --\u003e add 'hellow' to the name\n.subscribe(msg =\u003e p.innerHTML = msg); // --\u003e write it to the \u003cp\u003e element\n```\n\n**CONNECTIVE** is a thin layer on top of [**RxJS**](https://github.com/ReactiveX/rxjs), so it provides all the toolset of **rxjs** by proxy. However, while **RxJS**'s API is better suited for short-lived and small flows, **CONNECTIVE** adds tools better suiting long-living and large/complex flows.\n\nExample ([Stackblitz](https://stackblitz.com/edit/connective-delayed-broadcast)):\n\n```typescript\nimport './style.css';\n\nimport { wrap, gate, control, map, pin, pipe, group, spread, sink } from '@connectv/core';\nimport { fromEvent } from 'rxjs';\nimport { delay, debounceTime } from 'rxjs/operators';\n\nlet a = document.getElementById('a') as HTMLInputElement;\nlet p = document.getElementById('p');\n\nlet g = gate();                       // --\u003e gate helps us control the flow of the words\n\ngroup(control(), g.output)            // --\u003e open the gate every time it outputs something (also once initially)\n  .to(pin())                          // --\u003e this relays either gate output or initial `control()` emit\n  .to(pipe(delay(500)))               // --\u003e but wait 500ms before opening the gate\n  .to(g.control);                     // --\u003e controls when the gate opens up.\n\nwrap(fromEvent(a, 'input'))           // --\u003e wrap the `Observable` in a `Pin`\n  .to(pipe(debounceTime(2000)))       // --\u003e debounce for 2 seconds so people are done typing\n  .to(map(() =\u003e a.value.split(' ')))  // --\u003e map the event to value of input, splitted\n  .to(spread())                       // --\u003e spread the array to multiple emissions\n  .to(g)                              // --\u003e pass those emissions to the gate\n  .to(sink(() =\u003e p.classList.add('faded')))    // --\u003e fade the \u003cp\u003e when something comes out of the gate.\n  .to(pipe(delay(100)))                        // --\u003e wait 100 ms\n  .to(sink(v =\u003e p.innerHTML = v))              // --\u003e write the new word\n  .to(sink(() =\u003e p.classList.remove('faded'))) // --\u003e show the \u003cp\u003e again\n  .subscribe();                                // --\u003e bind everything.\n```\n\n\u003cbr\u003e\n\n# How To Install\n\nUsing NPM:\n\n```\nnpm i @connectv/core\n```\n\nUsing a CDN:\n\n```\n\u003cscript src=\"https://unpkg.com/rxjs/bundles/rxjs.umd.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/lodash@4.17.14/lodash.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript src=\"https://unpkg.com/@connectv/core/dist/bundles/connective.es5.min.js\"\u003e\u003c/script\u003e\n```\n\n\u003cbr\u003e\n\n# How To Use\n\nCheck out the [documentation](https://connective.dev).\n\n## Why Use This?\n\n**CONNECTIVE** provides a different API on top of **RxJS** that is more suitable for larger and more complex projects.\nYou can read more on this [here](https://connective.dev/docs/connective-v-rxjs).\n\n\u003cbr\u003e\n\n# How To Contribute\n\nCheck out the [contribution guide](CONTRIBUTING.md). Also check out the [code of conduct](CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnect-platform%2Fconnective","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnect-platform%2Fconnective","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnect-platform%2Fconnective/lists"}