{"id":16057412,"url":"https://github.com/aduth/prsh","last_synced_at":"2026-02-12T22:03:42.689Z","repository":{"id":49883779,"uuid":"247570849","full_name":"aduth/prsh","owner":"aduth","description":"Preact Redux Simple Hooks","archived":false,"fork":false,"pushed_at":"2025-02-19T15:38:58.000Z","size":345,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T08:53:09.643Z","etag":null,"topics":["preact","preact-hooks","react-hooks","redux"],"latest_commit_sha":null,"homepage":null,"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/aduth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-03-15T23:40:38.000Z","updated_at":"2024-10-05T14:41:44.000Z","dependencies_parsed_at":"2024-06-23T00:57:47.916Z","dependency_job_id":"f9c4a0ca-3f5b-4ea8-9cf6-482f931b6ab4","html_url":"https://github.com/aduth/prsh","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.4347826086956522,"last_synced_commit":"f73cb54913d57466533c9225f2e9a24fd24efae5"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aduth/prsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fprsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fprsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fprsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fprsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aduth","download_url":"https://codeload.github.com/aduth/prsh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aduth%2Fprsh/sbom","scorecard":{"id":168337,"data":{"date":"2025-08-11","repo":{"name":"github.com/aduth/prsh","commit":"6c66f1e9028defdd3b63664c6e2c419608e66ada"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/10 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":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/aduth/prsh/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/aduth/prsh/test.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"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":"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 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"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T15:35:06.829Z","repository_id":49883779,"created_at":"2025-08-16T15:35:06.829Z","updated_at":"2025-08-16T15:35:06.829Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29382885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T20:34:40.886Z","status":"ssl_error","status_checked_at":"2026-02-12T20:23:00.490Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["preact","preact-hooks","react-hooks","redux"],"created_at":"2024-10-09T03:02:13.160Z","updated_at":"2026-02-12T22:03:42.674Z","avatar_url":"https://github.com/aduth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Preact Redux Simple Hooks\n---\n\nPreact Redux Simple Hooks (**prsh**) is a tiny implementation of a set of [Preact](https://preactjs.com) [Hooks](https://preactjs.com/guide/v10/hooks) for interacting with a [Redux](https://redux.js.org) store. In the spirit of Preact, it aims to be small and fast, weighing in at only **219 bytes** minified and gzipped ([95% smaller than `react-redux`](https://bundlephobia.com/result?p=react-redux@7.2.0)).\n\n## Example\n\n```jsx\nimport { createElement } from 'preact';\nimport { createStore } from 'redux';\nimport { StoreContext, useSelector, useStore } from 'prsh';\n\nfunction counter( state = 0, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'INCREMENT':\n\t\t\treturn state + 1;\n\t}\n\n\treturn state;\n}\n\nconst store = createStore( counter );\n\nfunction CurrentCount() {\n\tconst count = useSelector( ( state ) =\u003e state );\n\n\treturn \u003cdiv\u003eCurrent value: { count }\u003c/div\u003e;\n}\n\nfunction IncrementButton() {\n\tconst { dispatch } = useStore();\n\n\treturn (\n\t\t\u003cbutton\n\t\t\ttype=\"button\"\n\t\t\tonClick={ () =\u003e dispatch( { type: 'INCREMENT' } ) }\n\t\t\u003e\n\t\t\tIncrement\n\t\t\u003c/button\u003e\n\t);\n}\n\nfunction AppRoot() {\n\treturn (\n\t\t\u003cStoreContext.Provider value={ store }\u003e\n\t\t\t\u003cCurrentCount /\u003e\n\t\t\t\u003cIncrementButton /\u003e\n\t\t\u003c/StoreContext.Provider\u003e\n\t);\n}\n\nrender( \u003cAppRoot /\u003e, document.body );\n```\n\nCodePen: https://codepen.io/aduth/pen/QWbrLWe\n\n## Installation\n\nUsing [npm](https://www.npmjs.com/):\n\n```\nnpm install prsh\n```\n\nOr, download a pre-built copy from unpkg:\n\nhttps://unpkg.com/prsh/dist/prsh.min.js\n\nOr, start using in your browser without any download or build tools:\n\n```html\n\u003cscript type=\"module\"\u003e\nimport { StoreContext, useSelector } from 'https://unpkg.com/prsh?module';\n// ...\n\u003c/script\u003e\n```\n\n## API\n\n### `StoreContext`\n\nThe context object which passes a Redux store instance through a component tree.\n\nA `StoreContext.Provider` should be rendered at the top-level of your application:\n\n```jsx\nfunction AppRoot() {\n\treturn (\n\t\t\u003cStoreContext.Provider value={ store }\u003e\n\t\t\t\u003cContent /\u003e\n\t\t\u003c/StoreContext.Provider\u003e\n\t);\n}\n```\n\nYou can also use this in combination with the [`useContext` hook](https://preactjs.com/guide/v10/hooks#context) to get direct access to the store.\n\n```jsx\nfunction ExampleComponent() {\n\tconst store = useContext( StoreContext );\n\n\t// ...\n}\n```\n\n### `useSelector`\n\nA hook which, given a selector function, returns a value from state. The hook creates a subscription to the store and ensures that your component is rerendered whenever the value changes.\n\n```jsx\nfunction DoneTasks() {\n\tconst todos = useSelector( ( state ) =\u003e state.todos );\n\tconst doneTasks = todos.filter( ( todo ) =\u003e todo.done );\n\n\treturn \u003cul\u003e{ doneTasks.map( ( task ) =\u003e \u003cli\u003e{ task.text }\u003c/li\u003e ) }\u003c/ul\u003e;\n}\n```\n\n`useSelector` uses strict equality `===` to determine whether the component should update. Because of this, you should be careful to note:\n\n- It is fine for a component to have multiple `useSelector` hooks in the same component. Avoid picking multiple parts of state into a single object or array return value, since an object or array will always be strictly unequal to the previous object or array (`{} !== {}`).\n- You should ensure that your selector returns a stable value, ideally a direct reference to a state path. Deriving state using operations like [Array#filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) should be done separate from the selector result, since `filter` will _always produce a new array value_ and could cause your component to update more frequently than is necessary. If you need to memoize an expensive derivation, you can consider to use [`useMemo`](https://preactjs.com/guide/v10/hooks#usememo) separate from your selector result.\n\n### `useStore`\n\nA hook which returns access to the store of the current context, most commonly to dispatch to the store:\n\n```jsx\nfunction IncrementButton() {\n\tconst { dispatch } = useStore();\n\n\treturn (\n\t\t\u003cbutton\n\t\t\ttype=\"button\"\n\t\t\tonClick={ () =\u003e dispatch( { type: 'INCREMENT' } ) }\n\t\t\u003e\n\t\t\tIncrement\n\t\t\u003c/button\u003e\n\t);\n}\n```\n\nThis is simply a shorthand of `useContext( StoreContext );`.\n\n## License\n\nCopyright 2020 Andrew Duthie\n\nReleased under the [MIT License](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faduth%2Fprsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faduth%2Fprsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faduth%2Fprsh/lists"}