{"id":39020526,"url":"https://github.com/tonyhb/autoaction","last_synced_at":"2026-01-17T17:28:06.364Z","repository":{"id":57187424,"uuid":"47245278","full_name":"tonyhb/autoaction","owner":"tonyhb","description":"Declarative data loading and action calling within react-redux","archived":false,"fork":false,"pushed_at":"2020-07-16T18:43:17.000Z","size":28,"stargazers_count":47,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T01:13:30.672Z","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/tonyhb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-12-02T07:43:24.000Z","updated_at":"2022-01-10T13:27:54.000Z","dependencies_parsed_at":"2022-08-28T13:00:16.373Z","dependency_job_id":null,"html_url":"https://github.com/tonyhb/autoaction","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/tonyhb/autoaction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyhb%2Fautoaction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyhb%2Fautoaction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyhb%2Fautoaction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyhb%2Fautoaction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonyhb","download_url":"https://codeload.github.com/tonyhb/autoaction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyhb%2Fautoaction/sbom","scorecard":{"id":893956,"data":{"date":"2025-08-11","repo":{"name":"github.com/tonyhb/autoaction","commit":"87b2477e801bd28cc05f20b0a3f81dfbeb2603f2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/tonyhb/.github/security.md:1","Info: Found linked content: github.com/tonyhb/.github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/tonyhb/.github/security.md:1","Info: Found text in security policy: github.com/tonyhb/.github/security.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T12:57:22.756Z","repository_id":57187424,"created_at":"2025-08-24T12:57:22.756Z","updated_at":"2025-08-24T12:57:22.756Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28512905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-17T17:28:06.217Z","updated_at":"2026-01-17T17:28:06.339Z","avatar_url":"https://github.com/tonyhb.png","language":"JavaScript","readme":"## AutoAction automatically calls redux actions on mount and prop changes\n\n----\n\n**For data loading this is deprecated in favour of: https://github.com/tonyhb/tectonic**\n\n----\n\nAutomatically call redux actions from state.\n\n### Setup:\n\n1. Put `@autoaction` **beneath** `@connect` so it receives new props from Redux\n2. Pass an object to the `@autoaction` decorator where:\n  i. array keys are action names\n  ii. array values are functions that accept params and state, and return array\n  arguments\n\n### How it works\n\n1. autoaction accepts a map of action-names to a function which returns action\n   arguments.\n2. if any arguments resolve to undefined we **don't call that action**. This\n   allows actions to update redux state, which then triggers other actions\n3. if actions are called multiple times with the same arguments **dedupe and\n   only call these once**. This allows child components in a tree to request \n   data that any parents request with ony one request to thee API.\n\nExamples:\n\n```js\n// Single argument:\n//\n// Automatically call getPost with state.router.params.slug, ie:\n// getPost(state.router.params.slug)\n@autoaction({\n  getPost: (params, state) =\u003e state.router.params.slug\n}, postActions)\n\n// Multiple arguments:\n// getPost(params.id, state.router.params.slug)\n@autoaction({\n  getPost: (params, state) =\u003e [params.id, state.router.params.slug]\n}, postActions)\n\n// Multiple arguments as object:\n// getPost({ id: params.id, slug: state.router.params.slug })\n@autoaction({\n  getPost: (params, state) =\u003e {\n    return: {\n      id: params.id,\n      slug: state.router.params.slug\n    };\n  }\n}, postActions)\n\n// Call an action each time a state/prop value changes but **isn't an action\n// argument**\n@autoaction({\n  // postActions.resetUI will be called with 'post' as the argument each time\n  // the 'key' updates (ie. state.router.params.slug changes)\n  resetUI: {\n    args: 'post',\n    key: (params, state) =\u003e state.router.params.slug\n  },\n}, postActions)\n```\n\n**And exactly how?**\n\nWe connect to redux state directly and listen to store changes.  We enqueue\naction calls in `componentWillMount` for all components and dispatch them in\n`componentDidMount`. This allows us to dedupe any action calls from children,\nallowing all components to request the same actions if need be.\n\nWhen we receive new props we enqueue actions and dispatch immediately. To\nprevent stack overflows we delete actions from the queue before dispatching.\n\n### API\n\n\n\n### Basic example\n\nAction:\n\n```js\n// Note that this function accepts an object and immediately destructures into\n// arguments. It is called via getPostBySlug({ slug: 'some-post' });\nexport function getPostBySlug({ slug }) {\n  return {\n    type: \"GET_POST\",\n    meta: {\n      promise: Axios.get(`/api/posts/${slug}`)\n    }\n  };\n}\n```\n\nComponent:\n\n```js\nimport autoaction from 'autoaction';\nimport * as postActions from 'actions/posts';\nimport { createStructuredSelector } from 'reselect';\n\nconst mapState = createStructuredSelector({\n  post: (state) =\u003e state.post,\n  comments: (state) =\u003e state.comments[state.post]\n});\n\n// In this example, getPostBySlug will be called from redux-router state\n// immediately.  `params.post.id` returns undefined and so\n// `getCommentsbyPostId` won't be called immediately.\n// When getPostBySlug resolves the component will receive post props and will\n// call getCommentsByPostID automatically.\n@connect(mapState)\n@autoaction({\n  getPostBySlug: (params, state) =\u003e { return { slug: state.router.params.slug }; }\n  getCommentsByPostID: (params, state) =\u003e params.post.id\n}, postActions)\nclass BlogPost extends Component {\n  static propTypes = {\n    post: PropTypes.object\n  }\n\n  render() {\n    return (\n      \u003ch1\u003epostActions.getPostBySlug was automatically called with the slug\n        router parameter!\u003c/h1\u003e\n    );\n  }\n}\n```\n","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonyhb%2Fautoaction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonyhb%2Fautoaction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonyhb%2Fautoaction/lists"}