{"id":19306468,"url":"https://github.com/fluse/alt-store-connect","last_synced_at":"2026-06-13T18:35:40.459Z","repository":{"id":38538180,"uuid":"90834051","full_name":"fluse/alt-store-connect","owner":"fluse","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-07T04:49:37.000Z","size":221,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T00:44:07.834Z","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/fluse.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":"2017-05-10T07:30:22.000Z","updated_at":"2020-01-08T09:24:52.000Z","dependencies_parsed_at":"2023-01-23T15:32:15.755Z","dependency_job_id":null,"html_url":"https://github.com/fluse/alt-store-connect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Falt-store-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Falt-store-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Falt-store-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Falt-store-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluse","download_url":"https://codeload.github.com/fluse/alt-store-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240408145,"owners_count":19796637,"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-10T00:06:26.158Z","updated_at":"2026-06-13T18:35:35.433Z","avatar_url":"https://github.com/fluse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connecting components to Alt stores\n\n## Install\n\n```\nnpm install alt-store-connect --save\n```\n\n`connectToStores` wraps a React component and control its props with data coming from Alt stores.\n\nThis module supports React 16\n\nExpects the Component to have two static methods:\n- `getStores()`: Should return an array of stores.\n- `getPropsFromStores(props)`: Should return the props from the stores.\n\n## Usage Examples\n\n### ES6 Class Higher Order Component\n\n```js\nimport React from 'react';\nimport myStore from './stores/myStore';\nimport connectToStores from 'alt-connect-store';\n\nclass MyComponent extends React.Component {\n\n    static getStores(props) {\n        return [myStore];\n    }\n\n    static getPropsFromStores(props) {\n        return myStore.getState();\n    }\n\n    render() {\n        // Use this.props like normal...\n    }\n}\n\nexport default connectToStores(MyComponent);\n```\n\n### ES7 Decorator\n\n```js\n\nimport React, { Component } from 'react'\nimport myStore from './stores/myStore'\nimport connectToStores from 'alt-connect-store'\n\n@connectToStores\nexport default class MyComponent extends Component {\n\n    static getStores(props) {\n        return [myStore]\n    }\n\n    static getPropsFromStores(props) {\n        return myStore.getState()\n    }\n\n    render() {\n        // Use this.props like normal...\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluse%2Falt-store-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluse%2Falt-store-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluse%2Falt-store-connect/lists"}