{"id":13806675,"url":"https://github.com/NullVoxPopuli/ember-lifecycle-component","last_synced_at":"2025-05-13T22:30:36.207Z","repository":{"id":37642217,"uuid":"228081246","full_name":"NullVoxPopuli/ember-lifecycle-component","owner":"NullVoxPopuli","description":"A component with additional lifecycles for times when you may not need need a template.","archived":true,"fork":false,"pushed_at":"2023-12-13T17:25:00.000Z","size":1262,"stargazers_count":9,"open_issues_count":43,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T04:42:14.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/NullVoxPopuli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2019-12-14T20:00:38.000Z","updated_at":"2023-12-13T17:25:11.000Z","dependencies_parsed_at":"2022-08-30T02:10:27.670Z","dependency_job_id":"b62ddaed-b0d2-4723-9d65-7fec81339679","html_url":"https://github.com/NullVoxPopuli/ember-lifecycle-component","commit_stats":{"total_commits":278,"total_committers":7,"mean_commits":"39.714285714285715","dds":0.262589928057554,"last_synced_commit":"6864db1a40c2c22b8d8e9ec1ba94b01529c0c436"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-lifecycle-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-lifecycle-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-lifecycle-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fember-lifecycle-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NullVoxPopuli","download_url":"https://codeload.github.com/NullVoxPopuli/ember-lifecycle-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036812,"owners_count":22003655,"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-04T01:01:14.608Z","updated_at":"2025-05-13T22:30:35.744Z","avatar_url":"https://github.com/NullVoxPopuli.png","language":"JavaScript","readme":"# Archived\n\nWhile this component is built on public APIs, I can no longer recommend it as it doesn't fit within the current meta for reactivity\n\n# ember-lifecycle-component\n\n[![npm version](https://badge.fury.io/js/ember-lifecycle-component.svg)](https://badge.fury.io/js/ember-lifecycle-component)\n[![CI](https://github.com/NullVoxPopuli/ember-lifecycle-component/actions/workflows/tests.yml/badge.svg?branch=master\u0026event=push)](https://github.com/NullVoxPopuli/ember-lifecycle-component/actions/workflows/tests.yml)\n\nFor situations where you don't need a template.\n- WebGL Integration\n- Other DOM-less situations\n\nThe `LifeCycleComponent` has the same interface as `@glimmer/component`, but with some additional hooks.\n\n**Generally, you do not need this. Nearly all side-effecting code can be represented as computed/tracked properties and regular getters while causing changes via the functions that would have started the side-effect anyway**.\n\nAll the hooks available for use are:\n\n- constructor(owner, args)\n- didReceiveArgs(prev, next)\n- didUpdate()\n- willDestroy()\n\n## Installation\n\n```\nember install ember-lifecycle-component\n```\n\n\n## Usage\n\n[More examples here, in the tests](https://github.com/NullVoxPopuli/ember-lifecycle-component/blob/master/tests/integration/components/renderless-test.js)\n\n```ts\nimport { LifeCycleComponent } from 'ember-lifecycle-component';\n\nimport THREE from 'three';\n\nlet geometry = new THREE.BoxGeometry( 2, 2, 2 );\nlet material = new THREE.MeshNormalMaterial();\n\nexport default class SceneBoxComponent extends LifeCycleComponent {\n  constructor(owner, args) {\n    super(owner, args);\n\n    this.mesh = new THREE.Mesh(geometry, material);\n\n    let { rx, ry, rz } = this.args;\n\n    this.#updateRotation(rx, ry, rz);\n    this.mesh.position.set(0, 0, 0);\n\n    args.scene.add(this.mesh);\n  }\n\n  didUpdate() {\n    let { rx, ry, rz } = this.args;\n    this.#updateRotation({ rx, ry, rz });\n  }\n\n  willDestroy() {\n    this.args.scene.remove(this.mesh);\n  }\n\n  #updateRotation({ rx, ry, rz }) {\n    this.mesh.rotation.set(rx, ry, rz);\n  }\n}\n```\n\n\n\n## Compatibility\n\n* See: config/ember-try.js\n\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","funding_links":[],"categories":["Packages"],"sub_categories":["External Components Integration"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNullVoxPopuli%2Fember-lifecycle-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNullVoxPopuli%2Fember-lifecycle-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNullVoxPopuli%2Fember-lifecycle-component/lists"}