{"id":16897784,"url":"https://github.com/behnammodi/jetstate","last_synced_at":"2026-05-17T02:39:22.674Z","repository":{"id":57280592,"uuid":"161763816","full_name":"behnammodi/jetstate","owner":"behnammodi","description":"state managment","archived":false,"fork":false,"pushed_at":"2021-02-22T11:08:39.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-21T15:15:48.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/behnammodi.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}},"created_at":"2018-12-14T09:42:35.000Z","updated_at":"2021-02-22T11:08:37.000Z","dependencies_parsed_at":"2022-09-18T15:22:10.625Z","dependency_job_id":null,"html_url":"https://github.com/behnammodi/jetstate","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behnammodi%2Fjetstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behnammodi%2Fjetstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behnammodi%2Fjetstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behnammodi%2Fjetstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behnammodi","download_url":"https://codeload.github.com/behnammodi/jetstate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243720212,"owners_count":20336775,"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-10-13T17:39:47.196Z","updated_at":"2025-10-16T21:52:29.097Z","avatar_url":"https://github.com/behnammodi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jetstate\n\n[![NPM](https://nodei.co/npm/jetstate.png)](https://nodei.co/npm/jetstate/)\n\n[![install size](https://packagephobia.now.sh/badge?p=jetstate)](https://packagephobia.now.sh/result?p=jetstate) [![dependencies](https://david-dm.org/uxitten/jetstate.svg)](https://david-dm.org/uxitten/jetstate.svg)\n\n\n\u003ca href=\"https://www.npmjs.com/package/jetstate\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/jetstate.svg\" alt=\"Version\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://www.npmjs.com/package/jetstate\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/jetstate.svg\" alt=\"License\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://www.npmjs.com/package/jetstate\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dm/jetstate.svg\" alt=\"Downloads\"\u003e\n\u003c/a\u003e\n\nstate managment\n\n## install\n```npm\nnpm i jetstate --save\n```\n\n## use\n```javascript\nimport { init, state } from 'jetstate';\n\n/**\n * initial new state\n */\ninit({\n  name: 'time',\n  defaultValue: new Date().getTime(), \n  willUpdate: (previousValue, nextValue) =\u003e {\n    console.log('willUpdate', previousValue, nextValue);\n  },\n  shouldUpdate: (previousValue, nextValue) =\u003e {\n    if (typeof nextValue 'number') return true;\n    else return false        \n  },\n  didUpdate: value =\u003e {\n    console.log('didUpdate', value);\n  }\n});\n\nvar time = state.time;\n\n//with this code, willUpdate is run and then didUpdate is run\nstate.time = new Date().getTime();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehnammodi%2Fjetstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehnammodi%2Fjetstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehnammodi%2Fjetstate/lists"}