{"id":18007703,"url":"https://github.com/orizens/affinity","last_synced_at":"2025-03-26T12:31:49.098Z","repository":{"id":66198338,"uuid":"155477132","full_name":"orizens/affinity","owner":"orizens","description":"affinity is a case study: an attempt to create a simple component based library","archived":false,"fork":false,"pushed_at":"2018-11-11T22:05:07.000Z","size":20,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T19:02:19.127Z","etag":null,"topics":["component-architecture","component-library","frontend-framework","library"],"latest_commit_sha":null,"homepage":"","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/orizens.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-31T00:58:14.000Z","updated_at":"2024-02-09T21:44:56.000Z","dependencies_parsed_at":"2023-04-12T18:03:08.740Z","dependency_job_id":null,"html_url":"https://github.com/orizens/affinity","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/orizens%2Faffinity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Faffinity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Faffinity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Faffinity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orizens","download_url":"https://codeload.github.com/orizens/affinity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245654201,"owners_count":20650823,"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":["component-architecture","component-library","frontend-framework","library"],"created_at":"2024-10-30T01:14:15.418Z","updated_at":"2025-03-26T12:31:49.093Z","avatar_url":"https://github.com/orizens.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# affinity\n\naffinity is an attempt to create a simple component based library with few time savers (event binding, store etc..)\n\n# What's included\n\n1. component\n2. store (mutiple)\n3. app (multiple)\n4. simple event binding\n5. component template is string literal\n\n# Component demo\n\n```js\nimport { app, component } from './affinity';\n\nexport const AfCardComponent = component({\n  tag: 'af-card',\n  view({ img = '', url = '', onGo, ...props }) {\n    return {\n      template: `\n      \u003cdiv class=\"card\"\n        @click=\"handleOnClick\"\u003e\n        \u003cimg class=\"card-img-bottom\" src=\"${img}\" alt=\"Card image cap\"\u003e\n        \u003cdiv class=\"card-body\"\u003e\n          \u003caf-title title=\"The Card Title\"\u003e\u003c/af-title\u003e\n          \u003cp class=\"card-text\"\u003eSome quick example text to build on the card title and make up the bulk of the card's content.\u003c/p\u003e\n          \u003cbutton class=\"btn btn-primary\"\u003eGo To ${url}\u003c/button\u003e\n        \u003c/div\u003e\n      \u003c/div\u003e\n    `,\n      handleOnClick(ev) {\n        onGo(url);\n      }\n    };\n  }\n});\n```\n\n# Live Demo\n\nhttps://stackblitz.com/edit/typescript-ak7kpp\n\n# Run This Repo\n\n1. `npm i`\n2. `npm start`\n3. open [http://localhost:3000](http://localhost:3000)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forizens%2Faffinity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forizens%2Faffinity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forizens%2Faffinity/lists"}