{"id":18904626,"url":"https://github.com/djyde/cans-plugin-modal-store","last_synced_at":"2026-03-04T14:30:25.719Z","repository":{"id":147580449,"uuid":"86484346","full_name":"djyde/cans-plugin-modal-store","owner":"djyde","description":"cans plugin for creating modal stores","archived":false,"fork":false,"pushed_at":"2017-03-31T10:11:19.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T10:31:17.151Z","etag":null,"topics":["cans"],"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/djyde.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":"2017-03-28T16:45:36.000Z","updated_at":"2018-12-09T12:53:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b797599-e9d0-4995-8f26-352874005b9b","html_url":"https://github.com/djyde/cans-plugin-modal-store","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djyde%2Fcans-plugin-modal-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djyde%2Fcans-plugin-modal-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djyde%2Fcans-plugin-modal-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djyde%2Fcans-plugin-modal-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/djyde","download_url":"https://codeload.github.com/djyde/cans-plugin-modal-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239889026,"owners_count":19713702,"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":["cans"],"created_at":"2024-11-08T09:09:04.044Z","updated_at":"2026-03-04T14:30:25.634Z","avatar_url":"https://github.com/djyde.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cans-plugin-modal-store\n\n[![npm](https://img.shields.io/npm/v/cans-plugin-modal-store.svg)](https://www.npmjs.com/package/cans-plugin-modal-store)\n[![circle](https://circleci.com/gh/djyde/cans-plugin-modal-store.svg?style=shield)](https://circleci.com/gh/djyde/cans-plugin-modal-store)\n\ncans plugin for creating modal store.\n\n## Usage\n\n```js\nimport cans, { inject } from 'cans'\nimport modalStorePlugin from 'cans-plugin-modal-store'\nimport Modal from '/path/to/Modal'\n\nconst app = cans()\n\napp.use(modalStorePlugin, { names: ['user'] })\n\nconst UserModal = inject(({ models }) =\u003e {\n  return (\n    \u003cModal visible={models.modals.user.visible}\u003e\n      \u003cdiv\u003eModal body\u003c/div\u003e\n      \u003cbutton onClick={models.modals.user.hide}\u003eHide Modal\u003c/button\u003e\n    \u003c/Modal\u003e\n  )\n})\n\nconst App = inject(({ models }) =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={models.modals.user.show}\u003eShow Modal\u003c/button\u003e\n      \u003cUserModal /\u003e\n    \u003c/div\u003e\n  )\n})\n```\n\n### options\n\n- modals\n  - name: string - modal name\n  - emptyRecord: any - default modal record. `{}` is by default\n  - title: (record) =\u003e string | Element - function that compute the modal title\n\n### observable property\n\n- visible: boolean.\n- title: string | Element - Computed modal value\n- record: any - Modal record\n- resetRecord(): reset record to `emptyRecord`\n- confirmLoading: boolean. Loading status\n- startLoading(): set `confirmLoading` to true\n- stopLoading(): set `confirmLoading` to false\n- show(record): set `visible` to true. `record` is optional\n- hide(): set `visible` to false\n\n# License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjyde%2Fcans-plugin-modal-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjyde%2Fcans-plugin-modal-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjyde%2Fcans-plugin-modal-store/lists"}