{"id":21094103,"url":"https://github.com/archakov06/yarlsm","last_synced_at":"2025-03-14T07:09:00.009Z","repository":{"id":111889457,"uuid":"188126627","full_name":"Archakov06/yarlsm","owner":"Archakov06","description":"Yet another redux like state manager.","archived":false,"fork":false,"pushed_at":"2019-06-03T13:45:37.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T01:41:36.949Z","etag":null,"topics":[],"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/Archakov06.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-22T23:20:31.000Z","updated_at":"2023-09-11T15:39:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"8c7cf76a-100f-4133-9478-1e43b9d5a9f9","html_url":"https://github.com/Archakov06/yarlsm","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/Archakov06%2Fyarlsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Fyarlsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Fyarlsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Fyarlsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Archakov06","download_url":"https://codeload.github.com/Archakov06/yarlsm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243538139,"owners_count":20307104,"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":[],"created_at":"2024-11-19T22:16:16.532Z","updated_at":"2025-03-14T07:08:59.989Z","avatar_url":"https://github.com/Archakov06.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Yarlsm** — Yet another redux like state manager.\n\nNot for production. Made for fun and practice.\n\n[![Edit xenodochial-satoshi-l190y](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/xenodochial-satoshi-l190y?fontsize=14)\n\n## index.js\n\n```js\nimport createStore from './store';\nimport reducers from './reducers';\n\nconst store = new createStore(reducers, {\n  tasks: [],\n});\n\nstore.listen(({ type, data, state }) =\u003e {\n  console.log('state changed', state, type, data);\n});\n\nstore.listen(({ type, data, state }) =\u003e {\n  console.log('Task deleted', 'TASKS:REMOVE');\n});\n\nstore.dispatch('TASKS:ADD', 'Get started');\nstore.dispatch('TASKS:ADD', 'Create store');\nstore.dispatch('TASKS:ADD', 'removed');\nstore.dispatch('TASKS:REMOVE', 2);\nstore.dispatch('TASKS:ADD', 'Test store');\n\n// state changed {tasks: ['Get started']} TASKS:ADD Get started\n// state changed {tasks: ['Get started', 'Create store']} TASKS:ADD Create store\n// state changed {tasks: ['Get started', 'Create store', 'removed']} TASKS:ADD removed\n// state changed {tasks: ['Get started', 'Create store']} TASKS:REMOVE 2\n// state changed {tasks: ['Get started', 'Create store', 'Test store']} TASKS:ADD Test store\n```\n\n## reducers.js\n\n```js\nexport default {\n  tasks: (state, type, payload) =\u003e {\n    switch (type) {\n      case 'TASKS:ADD':\n        return [...state, payload];\n      case 'TASKS:REMOVE':\n        return state.filter((_, index) =\u003e index !== Number(payload));\n      default:\n        return state;\n    }\n  },\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchakov06%2Fyarlsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchakov06%2Fyarlsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchakov06%2Fyarlsm/lists"}