{"id":19345577,"url":"https://github.com/future-team/eg-tools","last_synced_at":"2026-06-17T17:33:15.285Z","repository":{"id":57220255,"uuid":"58356872","full_name":"future-team/eg-tools","owner":"future-team","description":"react+redux基础组件（双向绑定、store可视视图、fetch、loadingbar等）","archived":false,"fork":false,"pushed_at":"2016-11-30T10:41:38.000Z","size":296,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-16T07:44:07.950Z","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/future-team.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":"2016-05-09T07:23:39.000Z","updated_at":"2021-05-07T03:50:17.000Z","dependencies_parsed_at":"2022-08-29T00:11:55.921Z","dependency_job_id":null,"html_url":"https://github.com/future-team/eg-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/future-team/eg-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/future-team","download_url":"https://codeload.github.com/future-team/eg-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-tools/sbom","scorecard":{"id":414697,"data":{"date":"2025-08-11","repo":{"name":"github.com/future-team/eg-tools","commit":"d270628813fb0befa0b5043cd5fede3d169f7e66"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/25 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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-18T23:32:14.854Z","repository_id":57220255,"created_at":"2025-08-18T23:32:14.854Z","updated_at":"2025-08-18T23:32:14.854Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34459607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-10T04:07:09.231Z","updated_at":"2026-06-17T17:33:15.268Z","avatar_url":"https://github.com/future-team.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eg-tools\n\n\n## Install\n\n```bash\n$ npm install eg-tools --save\n```\n\n## 依赖\n\n* immutable.js\n\n## Usage\n\n```js\n\n\t\t//BindReact,createReducer,fetch,fetching,promisefetch\n\t\t\n\t\timport React from 'react';\n\t\timport AppRouter from './containers/AppRouter';\n\t\timport {BindReact,fetch,createReducer} from 'eg-tools';\n\t\t\n\t\timport * as reducers from './reducers/index';\n\t\trequire('../less/index.less');\n\t\t//require('../less/public.less');\n\t\t\n\t\t/** BindReact   用于redux和react建立联系*/\n\t\t//autoShowFetching 是否自动显示loadingBar\n\t\t//middleware 自定义中间件\n\t\t//reducers redux store集合\n\t\t//barName loadingBar名字，有两种，分别为web和app两种选择\n\t\t//Module react 组件对象\n\t\t\n\t\tReact.render(\n\t\t\u003cBindReact Module={AppRouter} reducers={reducers} autoShowFetching={false} barName=\"web\" middleware={[]}\u003e\n\t\t    {\u003c!--此处元素会追加到页面的body结束符之前主内容外--\u003e}\n\t\t    \u003cdiv\u003e\u003c/div\u003e\n\t\t\u003c/BindReact\u003e,\n\t\tdocument.getElementById('root')\n\t\t);\n\t\t\n\t\t//数据获取\n\t\tfetch('test/test'/*url*/,{}/*params*/,function(data){\n\t\t\tdispatch({\n\t\t\t\ttype: actionType.QUERY,\n\t\t\t\tdata: data\n\t\t\t});\n\t\t}/*success callback*/,function(){}/*error callback*/,{}/*options*/)\n\t\t\n\t\t//promisefetch\n\t\timport {promisefetch as fetch} from 'eg-tools';\n\t\t\n\t\tfetch('/test',{\n\t\t    body:{},\n\t\t    timeout:null,\n\t\t    asyn:false,\n\t\t    dataType:'json',\n\t\t    header:{},\n\t\t    method:'get',\n\t\t}).then(function(data){\n    \n                dispatch({\n                    type: actionType.QUERY,\n                    data: data\n                });\n        }).then(()=\u003e{\n            console.dir('test fetch for promise');\n        }).then(()=\u003e{\n            console.dir('callback');\n        },(xhr)=\u003e{\n            console.dir(xhr);\n        });\n        \n\t\t\n\t\t//创建store\n\t\texport const test = createReducer(initialState, {\n            [actionType.QUERY]: (data, action) =\u003e {\n                return data.merge(Immutable.fromJS(action.data));\n            }\n        })\n        //增加全局失败提示方法，默认为空。若有fetch.errorEvent方法,则执行该方法。可统一处理。\n        //增加全局成功提示方法，默认为空。若有fetch.successEvent方法,则执行该方法\n        \n```\n\n## 双向绑定\n\n### 1. createReducer\n\n```js\n    \n    import { createReducer } from 'eg-tools';\n    import Immutable from 'immutable';\n    \n    import {actionType} from '../constants/action-type.es6';\n    \n    const initialState = Immutable.fromJS({\n        name:'init'\n    });\n    \n    export const test = createReducer('test',initialState, {\n        [actionType.QUERY]: (data, action) =\u003e {\n            return data.merge(Immutable.fromJS(action.data));\n        }\n    });\n```\n\n### 2. setStore\n\n```js\n    \n    import {bindingMixin} from 'eg-tools';\n    \n    @bindingMixin\n    export default class TestWebContainer extends Component {\n        constructor(props) {\n            super(props);\n            \n            //关联store\n            this.setBinding('test');\n    \n        }\n    }\n```\n\n### 3. binding\n\n```js\n\n        render() {\n            return (\n                \u003cdiv\u003e\n                    \u003cinput type=\"text\"  valueLink={this.binding('name')  } /\u003e\n                    {this.props.test.get('name') }\n                \u003c/div\u003e\n            );\n        }\n```\n\n## Manual Change Functions\n\n帮助用户快速根据reducer路径更改store值，避免写更多的action。\n\n1. 手动根据路径改变reducer的值:\n\n```js\n\n    this.manualChange('name', 'john');\n```\n\n2. 手动根据路径改变reducer的值:\n\n```js\n\n    this.manualChange('name', function(age){\n        return ++age;\n    });\n```\n\n\n## update\n\n* `version 3.0.3` 新增双向绑定，store数据可视视图\n* `version 4.0.2` 新增promise fetch方法，新增移动端loadingbar，增加fetch返回值为request对象 ；新增fetch loadingbar状态fetch_submit_begin；对外提供LoadingBar组件\n* `version 4.0.3` 更改双向绑定深入修改时的语法。\n* `version 4.0.4` 关闭自动弹出redux日志面板，改为通过autoDevTools来控制显示或隐藏。\n* `version 5.0.1` 修改mock url地址在深目录的情况下能够正常请求","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Feg-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuture-team%2Feg-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Feg-tools/lists"}