{"id":21202611,"url":"https://github.com/cundd/irlib","last_synced_at":"2025-07-20T10:35:14.746Z","repository":{"id":36573951,"uuid":"40879887","full_name":"cundd/irlib","owner":"cundd","description":"General purpose JavaScript framework","archived":false,"fork":false,"pushed_at":"2017-01-31T11:13:46.000Z","size":299,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T12:11:32.010Z","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/cundd.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":"2015-08-17T09:02:57.000Z","updated_at":"2016-03-15T10:19:33.000Z","dependencies_parsed_at":"2022-08-21T05:10:18.344Z","dependency_job_id":null,"html_url":"https://github.com/cundd/irlib","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cundd/irlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cundd%2Firlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cundd%2Firlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cundd%2Firlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cundd%2Firlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cundd","download_url":"https://codeload.github.com/cundd/irlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cundd%2Firlib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266111439,"owners_count":23877980,"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-11-20T20:17:23.846Z","updated_at":"2025-07-20T10:35:14.711Z","avatar_url":"https://github.com/cundd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"irlib\n=====\n\n\u003e A simple JavaScript library\n\n\nInstallation\n------------\n\nWith `npm`\n\n```bash\nnpm install irlib --save-dev\n```\n\nor `Composer`\n\n```bash\ncomposer require cundd/irlib\n```\n\nService Locator\n---------------\n\n### Create the Service Locator\n\n```javascript\nvar sl = new IrLib.ServiceLocator();\n```\n\n### Retrieve an instance\n\n```javascript\nvar controller = sl.get('registeredKey');\n```\n\n### Import a ES6 module and register it\n\n```javascript\nimport App from './App.js';\nsl.register('app', App);\n```\n\n### Register a factory method\n\n```javascript\nsl.register(\n        'appView',\n        function () {\n        \t\treturn new Instance();\n        }\n)    \n```\n\n### Register a controller with dependencies (inline)\n\n```javascript\nsl.registerMultiple({\n\tappController: IrLib.Controller.extend({\n\t\tneeds: ['appView'],\n\t\tevents: {\n\t\t\tclick: function (e) {\n\t\t\t\tif (e.target.id === 'save') {\n\t\t\t\t\tthis.appView.assignVariable('saved', this.appView.variables.saved + 1);\n\t\t\t\t\tthis.appView.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n});  \n```\n\n### Set the property name for the dependency\n\n```javascript\nsl.registerMultiple({\n\tappController: IrLib.Controller.extend({\n\t\tneeds: ['appView:view'],\n\t\tevents: {\n\t\t\tclick: function (e) {\n\t\t\t\tif (e.target.id === 'save') {\n\t\t\t\t\tthis.view.assignVariable('saved', this.view.variables.saved + 1);\n\t\t\t\t\tthis.view.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n});  \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcundd%2Firlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcundd%2Firlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcundd%2Firlib/lists"}