{"id":19401223,"url":"https://github.com/mishamyrt/effector-svelte","last_synced_at":"2026-01-05T09:06:15.972Z","repository":{"id":232020516,"uuid":"783248344","full_name":"mishamyrt/effector-svelte","owner":"mishamyrt","description":"☄️ Svelte bindings for effector","archived":false,"fork":false,"pushed_at":"2024-06-01T13:36:11.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T00:17:40.342Z","etag":null,"topics":["effector","state-management","svelte"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mishamyrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-04-07T11:05:38.000Z","updated_at":"2024-11-01T09:44:49.000Z","dependencies_parsed_at":"2024-04-07T13:29:59.373Z","dependency_job_id":"9ce2135b-7429-4b7b-9f39-34d29f460ec9","html_url":"https://github.com/mishamyrt/effector-svelte","commit_stats":null,"previous_names":["mishamyrt/effector-svelte"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Feffector-svelte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Feffector-svelte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Feffector-svelte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Feffector-svelte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mishamyrt","download_url":"https://codeload.github.com/mishamyrt/effector-svelte/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294766,"owners_count":20591899,"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":["effector","state-management","svelte"],"created_at":"2024-11-10T11:17:36.858Z","updated_at":"2026-01-05T09:06:15.960Z","avatar_url":"https://github.com/mishamyrt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ☄️ Effector Svelte [![Quality Assurance](https://github.com/mishamyrt/effector-svelte/actions/workflows/qa.yaml/badge.svg)](https://github.com/mishamyrt/effector-svelte/actions/workflows/qa.yaml)\n\nSvelte bindings for effector.\n\n## Installation\n\n```sh\npnpm add effector-svelte\n```\n\n## Modules\n\n### Gate\n\nGate replicates [the implementation from effector-react](https://effector.dev/en/api/effector-react/gate/). Provides the `createGate` function.\n\n#### `createGate`\n\n```ts\nimport { createGate } from 'effector-svelte'\n\nconst Gate = createGate()\n```\n\nThe function can take as a parameter a name or a configuration object.\n\n```ts\nconst NamedGate = createGate('name')\nconst IndexGate = createGate({\n  name: 'index',\n  defaultValue: -1\n})\n```\n\nThe return result of the `createGate` function will be a constructor of `Gate` type.\n\n#### `Gate`\n\n`Gate` is a Svelte component constructor with additional fields:\n\n- `.open` - `Event\u003cvoid\u003e` fired upon gate mounting.\n- `.close` - `Event\u003cvoid\u003e` fired upon gate unmounting.\n- `.state` - `Store\u003cT\u003e` containing the current state of the gate. This state derives from `state` prop when rendering the gate as a component.\n- `.status` - `Store\u003cboolean\u003e` indicating whether the gate is mounted.\n\n#### Component usage\n\nWrap your component in a Gate component. When the gate is rendered, its state properties will change.\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n  import { StatusGate } from './stores'\n\u003c/script\u003e\n\n\u003cStatusGate\u003e\n  \u003cslot /\u003e\n\u003c/StatusGate\u003e\n```\n\n#### Actions usage\n\nAdd a `use:gate` action element to the HTML and pass the gate as a parameter to it.\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n  import { gate } from 'effector-svelte'\n  import { StatusGate } from './stores'\n\u003c/script\u003e\n\n\u003cdiv use:gate={StatusGate}\u003e\n  \u003cslot /\u003e\n\u003c/div\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Feffector-svelte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishamyrt%2Feffector-svelte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Feffector-svelte/lists"}