{"id":15354926,"url":"https://github.com/capaj/mobx-stored","last_synced_at":"2025-07-26T16:11:27.588Z","repository":{"id":57299694,"uuid":"48990899","full_name":"capaj/mobx-stored","owner":"capaj","description":"Mobx observables persistent across browser tabs/sessions","archived":false,"fork":false,"pushed_at":"2018-12-26T14:35:40.000Z","size":199,"stargazers_count":39,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T02:45:23.585Z","etag":null,"topics":["localstorage","mobx","mobx-observables","single-page-applications"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/capaj.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":"2016-01-04T10:43:34.000Z","updated_at":"2022-12-06T07:34:08.000Z","dependencies_parsed_at":"2022-08-26T17:01:08.755Z","dependency_job_id":null,"html_url":"https://github.com/capaj/mobx-stored","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmobx-stored","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmobx-stored/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmobx-stored/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmobx-stored/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/mobx-stored/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637769,"owners_count":21137538,"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":["localstorage","mobx","mobx-observables","single-page-applications"],"created_at":"2024-10-01T12:21:42.504Z","updated_at":"2025-04-15T06:17:15.084Z","avatar_url":"https://github.com/capaj.png","language":"TypeScript","funding_links":[],"categories":["Awesome MobX"],"sub_categories":["Related projects and utilities"],"readme":"# mobx-stored\n\na simple utility for persisting POJO objects into localStorage via mobx observables. Not only they persist through sessions, they also synchronize via storage events across all browser tabs.\n\n## usage\n\n```javascript\nimport { localStored } from 'mobx-stored'\nimport { sessionStored } from 'mobx-stored' // for using sessionStorage rather than localStorage\n\nconst defaultUser = { email: null, firstname: null, lastname: null } \nconst observableUserProfile = localStored('userProfile', defaultUser, { // observableUserProfile is the default extended with the data from localStorage\n  delay: 500\n}) // last parameter is optional-mobx autorun options for running the save operation into the storage. Use higher delay if you store a lot of data\n\n// now any changes made to the observableUserProfile are synced in localStorage\n\nobservableUserProfile.name = 'Michael'\n\n// after 500ms and reloading the page\n\nobservableUserProfile.name === 'Michael' // true\n\n// revert to the default values\n\nobservableUserProfile.reset()\n\n// need to add new properties?\n\nobservableUserProfile.extend({\n  myNewProp: 1\n})\n\n//Don't need it anymore?\n\nobservableUserProfile.destroy() // removes it from localStorage\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fmobx-stored","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fmobx-stored","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fmobx-stored/lists"}