{"id":19097196,"url":"https://github.com/atmajs/compo-lazy","last_synced_at":"2026-06-18T04:31:59.741Z","repository":{"id":20914936,"uuid":"24202793","full_name":"atmajs/compo-lazy","owner":"atmajs","description":"Deferred rendering","archived":false,"fork":false,"pushed_at":"2017-10-11T20:13:07.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-23T12:43:54.794Z","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/atmajs.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}},"created_at":"2014-09-18T19:54:14.000Z","updated_at":"2017-02-10T13:42:00.000Z","dependencies_parsed_at":"2022-08-29T10:10:40.061Z","dependency_job_id":null,"html_url":"https://github.com/atmajs/compo-lazy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/atmajs/compo-lazy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmajs%2Fcompo-lazy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmajs%2Fcompo-lazy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmajs%2Fcompo-lazy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmajs%2Fcompo-lazy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atmajs","download_url":"https://codeload.github.com/atmajs/compo-lazy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmajs%2Fcompo-lazy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34476727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T03:39:22.954Z","updated_at":"2026-06-18T04:31:59.726Z","avatar_url":"https://github.com/atmajs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Lazy Component\n[![Build Status](https://travis-ci.org/atmajs/compo-lazy.png?branch=master)](https://travis-ci.org/atmajs/compo-lazy)\n[![Bower version](https://badge.fury.io/bo/compo-lazy.svg)](http://badge.fury.io/bo/compo-lazy)\n\n```scss\nLazy { /*Template*/ }\n```\n\nSub-nodes of the component won't be rendered until it is required. It will be instead only one Node Comment added to the DOM, which is the placeholder for the future nodes.\n\n\n### API\n\n- **`resolveLazy(?model)`** \u003ca name='resolveLazy'\u003e#\u003c/a\u003e\n\t\n\t- `model`: (optinal) When model is undefined, then the model object is taken, which was used during the first (initial) render process.\n\n\tRender the template to the document fragment, and then replace the placeholder with the nodes.\n\n### Inheritance\n\n```javascript\nmask.define('MyComponent', mask.Compo('Lazy', {\n\ttemplate: `button x-signal= 'click: message' \u003e 'Greet'`,\n\tconstructor () {\n\t\tsetTimeout(() =\u003e this.resolveLazy(), 100);\n\t},\n\tslots: {\n\t\tmessage () {\n\t\t\talert(this.model.name)\n\t\t}\n\t}\n}));\n\n$(body).appendMask('MyComponent', { name: 'Smith' });\n```\n\n```mask\ndefine MyComponent extends Lazy {\n\n\th4 \u003e 'Hello'\n}\n```\n\n### As `Self` Component\n\n```mask\nLazy #foo {\n\th4 \u003e 'hello'\n}\n```\n```javascript\napp.find('#foo').resolveLazy();\n```\n\n\u003e `onRenderStart` and `onRenderEnd` are called after the component was resolved\n\n### Examples\n\n- [/examples](/examples)\n\n```bash\n# install atma toolkit\nnpm install atma\n# run server\natma server\n\n# navigate `http://localhost:5777/examples/simple.html`\n```\n\n### Test\n```bash\nnpm test\n```\n\n:copyright: MIT - Atma.js Project","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatmajs%2Fcompo-lazy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatmajs%2Fcompo-lazy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatmajs%2Fcompo-lazy/lists"}