{"id":13394259,"url":"https://github.com/robinweser/alveron","last_synced_at":"2025-03-23T13:11:55.114Z","repository":{"id":40294588,"uuid":"141565163","full_name":"robinweser/alveron","owner":"robinweser","description":"Tiny (0.8kb) Elm-inspired state management for React","archived":false,"fork":false,"pushed_at":"2024-09-19T17:04:57.000Z","size":33080,"stargazers_count":75,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T21:10:07.189Z","etag":null,"topics":["context","elm","hooks","optimistic-ui","optimistic-updates","react","react-context","react-hooks","state","state-management"],"latest_commit_sha":null,"homepage":"https://alveron.js.org","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/robinweser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/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},"funding":{"github":"robinweser"}},"created_at":"2018-07-19T10:40:56.000Z","updated_at":"2024-11-23T15:50:29.000Z","dependencies_parsed_at":"2024-01-13T17:11:32.946Z","dependency_job_id":"af1f81e0-8fdc-4ed1-87c0-954462eb7663","html_url":"https://github.com/robinweser/alveron","commit_stats":{"total_commits":117,"total_committers":7,"mean_commits":"16.714285714285715","dds":0.6239316239316239,"last_synced_commit":"70bed5b98b82b9a7edd19ad8eabd75e44e272aea"},"previous_names":["rofrischmann/react-woodworm"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinweser%2Falveron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinweser%2Falveron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinweser%2Falveron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinweser%2Falveron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robinweser","download_url":"https://codeload.github.com/robinweser/alveron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104527,"owners_count":20561379,"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":["context","elm","hooks","optimistic-ui","optimistic-updates","react","react-context","react-hooks","state","state-management"],"created_at":"2024-07-30T17:01:14.070Z","updated_at":"2025-03-23T13:11:55.088Z","avatar_url":"https://github.com/robinweser.png","language":"JavaScript","funding_links":["https://github.com/sponsors/robinweser"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Alveron\n\nAlveron is a tiny (~0.8kb) [Elm](http://elm-lang.org)-inspired state management library for React with support asynchronous effects by default.\u003c/br\u003e\nIt's built on top of React's built-in hooks `useState` and `useOptimistic`.\n\n\u003cimg alt=\"npm version\" src=\"https://badge.fury.io/js/alveron.svg\"\u003e \u003cimg alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/alveron.svg\"\u003e \u003ca href=\"https://bundlephobia.com/result?p=alveron@latest\"\u003e\u003cimg alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/alveron.svg\"\u003e\u003c/a\u003e\n\n## Installation\n\n```sh\n# npm\nnpm i --save alveron\n# yarn\nyarn add alveron\n# pnpm\npnpm add alveron\n```\n\n\u003e **Caution**: Alveron requires `^react@16.3.0` to be present. If you want to use the optimstic APIs it even requires `^react@19.0.0`.\n\n## Documentation\n\nDocumentation is hosted on https://alveron.js.org\n\n\u003e We recommend starting with [Motivation](https://alveron.js.org/intro/motivation) and [Theoretical Background](https://alveron.js.org/intro/theoretical-background) to understand why Alveron exists and how it works.\n\n## Examples\n\n- [Counter](https://alveron.js.org/examples/counter)\n- [Todo List](https://alveron.js.org/examples/todo-list)\n- [Contact Form](https://alveron.js.org/examples/contact-form)\n\n## The Gist\n\n```tsx\nimport React from 'react'\n// alternatively we can useOptimsticStore wrapping useOptimistic under the hood\nimport { useStore } from 'alveron'\n\ntype Model = number\n\n// Actions return a tuple containing the new state and an optional effect\nconst actions = {\n  increment: (state: Model) =\u003e [state + 1],\n  incrementBy: (state: Model, increment: number) =\u003e [state + increment],\n  reset: () =\u003e [model],\n  resetAfter: (state: Model, duration: number) =\u003e [\n    state,\n    (actions) =\u003e setTimeout(actions.reset, duration),\n  ],\n}\n\nfunction Counter() {\n  const [state, { increment, decrement, incrementBy, resetAfter }] = useStore(actions, 0)\n\n  return (\n    \u003cdiv\u003e\n      Count: {state}\n      \u003cbutton onClick={() =\u003e increment()}\u003e+\u003c/button\u003e\n      \u003cbutton onClick={() =\u003e incrementBy(2)}\u003e+2\u003c/button\u003e\n      \u003cbutton onClick={() =\u003e resetAfter(1000)}\u003eReset after 1 second\u003c/button\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\n## Users\n\n- [dm-drogerie markt](https://dm.de)\n- [weser.io](https://weser.io)\n- [Zeit](http://zeit.co)\n\n## License\n\nAlveron is licensed under the [MIT License](http://opensource.org/licenses/MIT).\u003cbr\u003e\nDocumentation is licensed under [Creative Common License](http://creativecommons.org/licenses/by/4.0/).\u003cbr\u003e\nCreated with ♥ by [@robinweser](http://weser.io).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinweser%2Falveron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinweser%2Falveron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinweser%2Falveron/lists"}