{"id":19208258,"url":"https://github.com/mttankkeo/web_cookie","last_synced_at":"2025-07-24T14:10:46.086Z","repository":{"id":197848507,"uuid":"699486575","full_name":"MTtankkeo/web_cookie","owner":"MTtankkeo","description":"Ideally Implemented simple web client-cookie source code, and using Typescript.","archived":false,"fork":false,"pushed_at":"2024-01-25T16:28:59.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T15:45:20.347Z","etag":null,"topics":["client-side","cookie","typescript-library","web"],"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/MTtankkeo.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}},"created_at":"2023-10-02T18:20:55.000Z","updated_at":"2024-08-05T20:55:46.000Z","dependencies_parsed_at":"2024-01-25T17:52:09.759Z","dependency_job_id":null,"html_url":"https://github.com/MTtankkeo/web_cookie","commit_stats":null,"previous_names":["mttankkeo/web_cookie"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTtankkeo%2Fweb_cookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTtankkeo%2Fweb_cookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTtankkeo%2Fweb_cookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTtankkeo%2Fweb_cookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MTtankkeo","download_url":"https://codeload.github.com/MTtankkeo/web_cookie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280986,"owners_count":19776418,"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":["client-side","cookie","typescript-library","web"],"created_at":"2024-11-09T13:25:13.235Z","updated_at":"2025-02-23T07:14:21.566Z","avatar_url":"https://github.com/MTtankkeo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Cookie\nIdeally Implemented simple web client-cookie source code, and using Typescript.\u003cbr\u003e\n`See also: cookies are rarely controlled directly by the client.`\n\n\u003e The example doesn't work in the local environment.\n\n## Usage\n\n### Get instance of cookie object\nThe following describes how to get a instance of cookie object.\n\n```ts\n// Not Null-Safety\nconst version = Cookie.getObjectByKey\u003cstring\u003e(\"version\");\n```\n\n```ts\n// Null-Safety\nconst version = Cookie.getObjectByKeyWithNullSafe\u003cstring\u003e(\"version\", \"1.0.0\");\n```\n\n```ts\nconst cookies: CookieObject\u003cany\u003e[] = Cookie.objects;\n```\n\n### Set value of cookie object\nThe following describes how to define a value of cookie object.\n\n```ts\n// Useing setter\nversion.value = \"1.0.0\";\n\n// Useing function.\nversion.setValue(\"1.0.0\");\n```\n\n## Listener\nThe following describes how to register a callback function that is called whenever the value of a cookie object updates.\n\n### globally register listener\n```ts\nCookie.addListener\u003cstring\u003e({\n      key: \"version\",\n      listener(value: string) {\n          console.log(`Update to ${value}`);\n      },\n})\n```\n\n### Register listener by instance\n```ts\nconst version = Cookie.getObjectByKeyWithNullSafe(\"version\", \"1.0.0\");\n\nversion.addListener(value =\u003e {\n    console.log(`Update to ${value}`);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmttankkeo%2Fweb_cookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmttankkeo%2Fweb_cookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmttankkeo%2Fweb_cookie/lists"}