{"id":15374012,"url":"https://github.com/jonaslu/mvvc-very-light","last_synced_at":"2025-04-06T00:12:52.376Z","repository":{"id":68404896,"uuid":"53890840","full_name":"jonaslu/MVVC-very-light","owner":"jonaslu","description":"Test run of how I think knockout.js does it","archived":false,"fork":false,"pushed_at":"2017-01-18T18:54:10.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T06:21:34.177Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonaslu.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":"2016-03-14T20:49:00.000Z","updated_at":"2016-03-14T20:49:23.000Z","dependencies_parsed_at":"2023-02-22T10:30:56.479Z","dependency_job_id":null,"html_url":"https://github.com/jonaslu/MVVC-very-light","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/jonaslu%2FMVVC-very-light","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2FMVVC-very-light/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2FMVVC-very-light/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaslu%2FMVVC-very-light/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonaslu","download_url":"https://codeload.github.com/jonaslu/MVVC-very-light/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415976,"owners_count":20935387,"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-01T13:56:59.519Z","updated_at":"2025-04-06T00:12:52.367Z","avatar_url":"https://github.com/jonaslu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MVVC-very-light\nTest run of how I think knockout.js does it.\n\n# data-bind=\"\" attribute\nScans the html for a data-bind=\"\" attribute. If found, get the element\nand parse the text inside the data-bind=\"\" value (and white-wash it\nfor whitespace).\n\nSplit the text on : looking for the binding on the left\nside and the observable/primitive value on the right.\n\nFind the binding and call init() on it...\n\n# Bindings\nAre added in an object with bindings at the top of the file.\nThis array (which could be exposed outwards) connects a\ndata-bind=\"text: \" \u003c= that directive to an object with that\nname on the bindings object.\n\nThe bindings has two (one obligatory - init, and one semi-obligatory\nupdate (if the init contains any observables)) which has\nan element and the bound observable\n(data-bind=\"text: observable\" \u003c= that value) as the callback.\n\n# Dependency tracking\nDone via having a dependencies array, so when the init()\nfunction of a binding runs - that array (which is only defined\nwhen the bindings are applied the first time) is populated\nif a value is get during the init() run.\n\nThen, if any observables are pushed to that array a callback\ncalling the update() function of that binding is set up.\n\n[script.js](../blob/master/script.js) contains the ko(py) object that does the bindings and contains observables.\n[index.html](../blob/master/index.html) is the poor view displaying all the profanities.\n\n# Running it\n```\nnpm install\nnpm start\n```\n\nSurf to http://localhost:8100/ and watch the magic happen.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaslu%2Fmvvc-very-light","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonaslu%2Fmvvc-very-light","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaslu%2Fmvvc-very-light/lists"}