{"id":22011509,"url":"https://github.com/lasalefamine/polymer-lib-loader","last_synced_at":"2025-05-06T19:09:03.538Z","repository":{"id":57327207,"uuid":"69197903","full_name":"LasaleFamine/polymer-lib-loader","owner":"LasaleFamine","description":"Polymer (ES6) external (or internal) library loader component","archived":false,"fork":false,"pushed_at":"2017-09-06T21:50:16.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-27T05:01:29.802Z","etag":null,"topics":["async","library","loader","polymer"],"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/LasaleFamine.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2016-09-26T00:02:46.000Z","updated_at":"2019-02-23T07:46:00.000Z","dependencies_parsed_at":"2022-08-30T20:00:53.236Z","dependency_job_id":null,"html_url":"https://github.com/LasaleFamine/polymer-lib-loader","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fpolymer-lib-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fpolymer-lib-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fpolymer-lib-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasaleFamine%2Fpolymer-lib-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasaleFamine","download_url":"https://codeload.github.com/LasaleFamine/polymer-lib-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227254019,"owners_count":17754201,"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":["async","library","loader","polymer"],"created_at":"2024-11-30T02:17:12.086Z","updated_at":"2024-11-30T02:17:12.728Z","avatar_url":"https://github.com/LasaleFamine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `\u003clib-loader\u003e` Polymer (ES6)\n\n[![Build status](https://travis-ci.org/LasaleFamine/polymer-lib-loader.svg?branch=master)](https://travis-ci.org/LasaleFamine/polymer-lib-loader)\n[![Bower version](https://badge.fury.io/bo/polymer-lib-loader.svg)](https://badge.fury.io/bo/polymer-lib-loader)\n[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![Dependency Status](https://gemnasium.com/badges/github.com/LasaleFamine/polymer-lib-loader.svg)](https://gemnasium.com/github.com/LasaleFamine/polymer-lib-loader)\n \n\n\u003e Library loader WebComponent for external (or internal) library. Written in [Polymer 1.0](https://www.polymer-project.org/1.0/) in ES6 syntax.\n\n## Why\n\nA simple component for delegate the task to import an external library.  \nIf you need to wrap a functionality of a library and load it only inside a component.  \nExample:\n\n``` html\n\u003clink rel=\"import\" href=\"[your_bower_folder]/polymer-lib-loader/lib-loader.html\"\u003e\n\n\u003clib-loader\nlib=\"https://cdnjs.cloudflare.com/ajax/libs/[lib]/[version]/[lib].js\"\nlib-unique-id=\"uniqueIdHere\"\n on-lib-loaded=\"yourCallbackOnLoad\"\u003e\u003c/lib-loader\u003e\n\n[...]\n\nyourCallbackOnLoad: function () {\n  console.log('loaded')\n  yourLib.doingSomenthing('yo')\n},\n\n[...]\n```\n\nSee the [`demo`](https://github.com/LasaleFamine/polymer-lib-loader/blob/master/demo/) folder for more details.\n\n## Install\n\n    $ bower install polymer-lib-loader\n\n\n## Default Properties\n``` js\n\n{\n  /** Instance link **/\n  lib: {\n    type: String\n  },\n  /** \u003cscript id=\"\"\u003e */\n  libUniqueId: {\n    type: String\n  },\n  /** True when the lib is ready */\n  libReady: {\n    type: Boolean,\n    value: false\n  }\n}\n\n```\n\n## Note on library load\nThe ability of the component to load the library and not reload it again and again is related to the `libUniqueId`.  \nThe `\u003cscript id=\"yourId\" src=\"yourLibLink\"\u003e` will be attached as a child of the `body` and **removed when the component is detached** (or when a wrapper of it is detached).\n\n## API\n\n#### .removeLib()\nRemove the library from the page\n____\n\n\n### Events\n\n#### on-lib-loaded\nWhen the initialization of the library is complete\n\n\n## Develop\n\nClone the repository ***inside a folder*** (ex: `sandbox-polymer-lib-loader/polymer-lib-loader`) and inside the `polymer-lib-loader` folder:\n\n    $ npm install \u0026\u0026 bower install\n\nDeveloping mode: **watch** on base files and **Babel** that transpiles (http://localhost:8080/polymer-lib-loader/demo)\n\n    $ npm start\n\nBuild: only the **Babel** action simply run\n\n    $ npm run build\n\n\n## Test\n\n[Standard](https://github.com/feross/standard) for coding style and [WCT](https://github.com/polymer/web-component-tester) for unit test:\n\n    $ npm test\n\n## License\n\n[MIT](https://github.com/LasaleFamine/polymer-lib-loader/blob/master/LICENSE.md) \u0026copy; LasaleFamine\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasalefamine%2Fpolymer-lib-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasalefamine%2Fpolymer-lib-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasalefamine%2Fpolymer-lib-loader/lists"}