{"id":18002745,"url":"https://github.com/cygnusroboticus/uivm","last_synced_at":"2026-05-05T23:32:43.718Z","repository":{"id":40240446,"uuid":"302213063","full_name":"CygnusRoboticus/uivm","owner":"CygnusRoboticus","description":"UI view model generation library","archived":false,"fork":false,"pushed_at":"2023-01-07T22:08:38.000Z","size":4051,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T09:15:13.947Z","etag":null,"topics":["forms","state-management","ui"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/CygnusRoboticus.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":"2020-10-08T02:34:58.000Z","updated_at":"2021-09-12T14:21:35.000Z","dependencies_parsed_at":"2023-02-08T02:47:49.396Z","dependency_job_id":null,"html_url":"https://github.com/CygnusRoboticus/uivm","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/CygnusRoboticus/uivm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CygnusRoboticus%2Fuivm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CygnusRoboticus%2Fuivm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CygnusRoboticus%2Fuivm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CygnusRoboticus%2Fuivm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CygnusRoboticus","download_url":"https://codeload.github.com/CygnusRoboticus/uivm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CygnusRoboticus%2Fuivm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32672643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["forms","state-management","ui"],"created_at":"2024-10-29T23:23:42.049Z","updated_at":"2026-05-05T23:32:43.697Z","avatar_url":"https://github.com/CygnusRoboticus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIVM: User Interface View Models\n\nA library for creating framework- and interface-agnostic view models with a variety of options.\n\n## Installation and Usage\n\n```sh\nnpm install uivm\nyarn add uivm\n```\n\nSample control usage. [Sandbox](https://codesandbox.io/s/morning-wood-3f8jx?file=/src/index.ts)\n\n```ts\nimport { tuple } from \"fp-ts/lib/function\";\nimport { FieldControl, GroupControl } from \"uivm\";\n\nconst viewModel = new GroupControl({\n  firstName: new FieldControl(\"John\"),\n  lastName: new FieldControl(\"Wick\"),\n  group: (() =\u003e\n    new GroupControl({\n      username: new FieldControl(\"keanu@keanu.com\"),\n      password: new FieldControl(null, {\n        hints: [() =\u003e tuple(\"private\", true)],\n      }),\n      rememberMe: new FieldControl(false),\n    }))(),\n});\n\nconsole.log(viewModel.value.group.username); // keanu@keanu.com\nviewModel.state$.subscribe(console.log);\n```\n\nSample config usage, this produces a view model identical to the above. [Sandbox](https://codesandbox.io/s/jolly-bogdan-y1kvz?file=/src/index.ts)\n\n```ts\nimport { BasicVisitor, BasicRegistry, createConfigBuilder, FieldConfig, GroupConfig, GroupControl } from \"uivm\";\n\ninterface CustomGroupConfig extends GroupConfig\u003cCustomConfigs, BasicRegistry\u003e, FieldConfig\u003cBasicRegistry\u003e {\n  type: \"group\";\n}\n\ninterface TextConfig extends FieldConfig\u003cBasicRegistry\u003e {\n  type: \"text\";\n}\n\ninterface CheckboxConfig extends FieldConfig\u003cBasicRegistry\u003e {\n  type: \"checkbox\";\n}\n\ntype CustomConfigs = CustomGroupConfig | TextConfig | CheckboxConfig;\n\nconst config: CustomConfigs = {\n  type: \"group\",\n  name: \"group\",\n  fields: [\n    { type: \"text\", name: \"firstName\" },\n    { type: \"text\", name: \"lastName\" },\n    {\n      type: \"group\",\n      name: \"group\",\n      fields: [\n        { type: \"text\", name: \"username\" },\n        {\n          type: \"text\",\n          name: \"password\",\n          hints: {\n            private: [{ name: \"static\", params: { value: true } }],\n          },\n        },\n        { type: \"checkbox\", name: \"rememberMe\" },\n      ],\n    },\n  ],\n};\n\nconst visitor = new BasicVisitor\u003cCustomConfigs, BasicRegistry\u003e();\nconst bundler = createConfigBuilder\u003cCustomConfigs, BasicRegistry, typeof visitor\u003e(new BasicRegistry(), visitor);\n\nconst control = bundler\u003c\n  typeof config,\n  GroupControl\u003c{\n    firstName: string;\n    lastName: string;\n    group: {\n      username: string;\n      password: string | null;\n      rememberMe: boolean;\n    };\n  }\u003e\n\u003e(config);\ncontrol.reset({\n  firstName: \"John\",\n  lastName: \"Wick\",\n  group: {\n    username: \"keanu@keanu.com\",\n    password: null,\n    rememberMe: false,\n  },\n});\n\ncontrol.state$.subscribe(console.log);\n```\n\n## Demo\n\nhttps://cygnusroboticus.github.io/uivm\n\n## Building/Testing\n\n- `yarn build` build everything\n- `yarn test` run tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcygnusroboticus%2Fuivm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcygnusroboticus%2Fuivm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcygnusroboticus%2Fuivm/lists"}