{"id":16868362,"url":"https://github.com/angus-c/es6-react-mixins","last_synced_at":"2026-03-05T00:32:47.117Z","repository":{"id":30997718,"uuid":"34556096","full_name":"angus-c/es6-react-mixins","owner":"angus-c","description":"universal mixin adapter for react","archived":false,"fork":false,"pushed_at":"2017-08-18T21:57:41.000Z","size":49,"stargazers_count":151,"open_issues_count":3,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-19T11:13:20.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/angus-c.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}},"created_at":"2015-04-25T05:04:53.000Z","updated_at":"2025-09-04T15:46:50.000Z","dependencies_parsed_at":"2022-09-08T23:01:31.095Z","dependency_job_id":null,"html_url":"https://github.com/angus-c/es6-react-mixins","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/angus-c/es6-react-mixins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angus-c%2Fes6-react-mixins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angus-c%2Fes6-react-mixins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angus-c%2Fes6-react-mixins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angus-c%2Fes6-react-mixins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angus-c","download_url":"https://codeload.github.com/angus-c/es6-react-mixins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angus-c%2Fes6-react-mixins/sbom","scorecard":{"id":196541,"data":{"date":"2025-08-11","repo":{"name":"github.com/angus-c/es6-react-mixins","commit":"5eda9839097911d4479dac636a75343b5b099cc1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"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":"Code-Review","score":1,"reason":"Found 4/25 approved changesets -- score normalized to 1","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":"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":"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":"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":"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 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-16T21:55:28.303Z","repository_id":30997718,"created_at":"2025-08-16T21:55:28.303Z","updated_at":"2025-08-16T21:55:28.303Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30102396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T23:59:36.199Z","status":"ssl_error","status_checked_at":"2026-03-04T23:56:48.556Z","response_time":59,"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":[],"created_at":"2024-10-13T14:58:01.792Z","updated_at":"2026-03-05T00:32:47.053Z","avatar_url":"https://github.com/angus-c.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# es6-react-mixins\n\n[![Build Status](https://secure.travis-ci.org/angus-c/es6-react-mixins.png?branch=master)](http://travis-ci.org/angus-c/es6-react-mixins) [![npm version](http://img.shields.io/npm/v/es6-react-mixins.svg)](https://npmjs.org/package/es6-react-mixins)\n\n`es6-react-mixins` is a module that lets you augment your ES6 React component classes with any number of custom ES6 mixins. You can also use it to merge traditional pre-ES6 React mixin objects into your ES6 React classes.\n\nInspired by [this gist](https://gist.github.com/sebmarkbage/fac0830dbb13ccbff596) by [Sebastian Markbåge](https://github.com/sebmarkbage) the strategy is transient class hierarchies – instead of locking classes into permanent *is a* roles, class realtionships are assembled and re-assembled at will.\n\nES6 mixins are functions that return classes. The `base` parameter is used internally to construct the mixin chain. There's no need to extend `React.component`, you get that for free.\n\n```js\nconst es6Mixin = base =\u003e class extends base {\n  componentWillMount() {\n    console.log(\"augmented componentWillMount\");\n  }\n  render() {\n    console.log(\"augmented render\");\n  }\n};\n```\n\nReact components invoke mixins with a call to `super`.\n\n```js\nimport mixin from 'es6-react-mixins';\nimport React from 'react';\n\nclass MyComponent extends mixin(es6Mixin) {\n  componentWillMount() {\n    super.componentWillMount();\n  }\n  render() {\n    super.render();\n    return \u003cdiv\u003ehello/div\u003e;\n  }\n}\n\nReact.render(\u003cMyComponent\u003e, document.body);\n```\nThe API works with any number of mixins. Obviously order matters with multiple mixins – each `super` call works its way up the mixin hierarchy.\n\n```js\nconst mixin1 = base =\u003e class extends base {\n  componentWillMount() {\n    super.componentWillMount();\n    console.log(\"mixin1 componentWillMount\");\n  }\n  render() {\n    super.render();\n    console.log(\"mixin1 render\");\n  }\n};\n\nconst mixin2 = base =\u003e class extends base {\n  componentWillMount() {\n    super.componentWillMount();\n    console.log(\"mixin2 componentWillMount\");\n  }\n  render() {\n    super.render();\n    console.log(\"mixin2 render\");\n  }\n};\n\nclass MyComponent extends mixin(mixin1, mixin2) {\n  componentWillMount() {\n    super.componentWillMount();\n  }\n  render() {\n    super.render();\n    return \u003cdiv\u003ehello/div\u003e;\n  }\n}\n```\n\nNotice that any mixin can call `super`, even though there may be no other mixins to hear it. Every mixin descends from a base mixin with no-op implementations of the react lifecycle methods.\n\n`es6-react-mixins` also accepts traditional plain object mixins (a la pre-ES6 React), adapting them to ES6 style mixins internally.\n\n```js\nvar reactMixin = {\n  componentWillMount: function () {\n    console.log\n  },\n  render: function () {\n    this.reactMixin_rendered = true;\n  }\n};\n\nclass MyComponent extends mixin(reactMixin) {\n  componentWillMount() {\n    super.componentWillMount();\n  }\n  render() {\n    super.render();\n    return \u003cdiv\u003ehello/div\u003e;\n  }\n}\n```\n\n# Installation\n\n```\nnpm install es6-react-mixins\n```\n\nThe source is written in es6 but there's an npm prebublish step which transpiles to es5 and dumps into `lib` directory - which is the default import.\n\n# Testing\n\n```\nnpm test\n```\n\n# Contributions\n\nYes please!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangus-c%2Fes6-react-mixins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangus-c%2Fes6-react-mixins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangus-c%2Fes6-react-mixins/lists"}