{"id":13565499,"url":"https://github.com/lmettini/data-obs","last_synced_at":"2025-04-03T22:31:34.734Z","repository":{"id":12137589,"uuid":"14730157","full_name":"lmettini/data-obs","owner":"lmettini","description":"Simple javascript data observer","archived":false,"fork":false,"pushed_at":"2017-05-30T11:09:21.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T19:41:41.298Z","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/lmettini.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":"2013-11-26T21:49:09.000Z","updated_at":"2023-06-10T05:22:59.000Z","dependencies_parsed_at":"2022-07-21T12:48:02.557Z","dependency_job_id":null,"html_url":"https://github.com/lmettini/data-obs","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/lmettini%2Fdata-obs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmettini%2Fdata-obs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmettini%2Fdata-obs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmettini%2Fdata-obs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmettini","download_url":"https://codeload.github.com/lmettini/data-obs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247090254,"owners_count":20881940,"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-08-01T13:01:48.502Z","updated_at":"2025-04-03T22:31:34.313Z","avatar_url":"https://github.com/lmettini.png","language":"JavaScript","readme":"# data-obs  \nLightweigh data observer, no need to load heavy libraries. Just store your data and add some triggers when this data change. If you want to see it working, here is a [dummy demo](http://lmettini.github.io/data-obs-demo/)\n\n## how it works\nYou set or observe data using a same data-id, that's the way the triggers are linked to the data\n### set data interface\nThe data-id is an unique string/interger that will be use to observe any change in the future of the data stored in the dataObs, the data could be any type of Object\n```javascript\ndataObs.set('data-id' ,data);\n```\n### observe interface\nTo observe the changes of a data-id you need to create a function that will recieve one parameter, that function is the trigger that is executed every time the data change. When a trigger is set to observer is going to be executed in the case when some data already stored with the same data-id.\n```javascript\ndataObs.observe('data-id' ,function(data){\n    // do your stuff here ;)\n});\n```\n### get data interface\nAlso you can check the value that a data-id have assigned\n```javascript\ndataObs.get('data-id');\n```\n# License\n\nMIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmettini%2Fdata-obs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmettini%2Fdata-obs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmettini%2Fdata-obs/lists"}