{"id":23058659,"url":"https://github.com/suhdev/strikejs-di","last_synced_at":"2025-04-03T06:18:36.878Z","repository":{"id":57372321,"uuid":"89628175","full_name":"suhdev/strikejs-di","owner":"suhdev","description":"A ReactJS class to manage dependencies declaratively. Written in TypeScript. ","archived":false,"fork":false,"pushed_at":"2017-04-30T22:05:13.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-06T21:47:41.769Z","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/suhdev.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-04-27T18:27:35.000Z","updated_at":"2017-04-27T19:10:51.000Z","dependencies_parsed_at":"2022-09-01T17:32:19.189Z","dependency_job_id":null,"html_url":"https://github.com/suhdev/strikejs-di","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/suhdev%2Fstrikejs-di","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstrikejs-di/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstrikejs-di/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstrikejs-di/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhdev","download_url":"https://codeload.github.com/suhdev/strikejs-di/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944383,"owners_count":20858772,"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-12-16T02:16:54.632Z","updated_at":"2025-04-03T06:18:36.869Z","avatar_url":"https://github.com/suhdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strikejs-di\n\nA declarative way to manage dependencies in ReactJS applications. A ReactJS component written in TyepScript to manage dependencies. \n\n```jsx\n\n//ES6 imports \nimport * as DI from 'strikejs-di'; \nimport * as React from 'react'; \nimport * as ReactDOM from 'react-dom'; \n\n//commonjs imports \n\nconst DI = require('strikejs-di');\nconst React = require('react'); \nconst ReactDOM = require('react-dom'); \n\nfunction makeStore(){\n    let obj = {}; \n    return {\n        set(key:string,val:any){\n            obj[key] = val; \n            return this; \n        },\n        get(key:string){\n            return obj[key]; \n        }\n    };\n}\n\nconst store = makeStore(); \nstore.set('test1','Just a test')\n    .set('test2',2)\n    .set('test3',{\n        firstName:\"John\",\n        lastName:\"Doe\"\n    }}); \n\n\nclass C1 extends React.Component\u003cany,any\u003e{\n    render(){\n        return (\n            \u003cdiv className=\"test\"\u003e\n                \u003cdiv\u003e{this.props.dep1}\u003c/div\u003e\n                \u003cdiv className=\"test-1\"\u003e{this.props.dep2}\u003c/div\u003e\n            \u003c/div\u003e\n        ); \n    }\n}\n\nclass C2 extends React.Component\u003cany,any\u003e{\n    render(){\n        return (\n            \u003cdiv className=\"test-2\"\u003e\n                \u003cdiv\u003e{this.props.test1}\u003c/div\u003e\n                \u003cdiv className=\"test-1\"\u003e{this.props.test2}\u003c/div\u003e\n                {this.props.children}\n            \u003c/div\u003e\n        ); \n    }\n}\n\nlet div = documet.createElement('div'); \ndocument.querySelector('body').appendChild(div); \n\nReactDOM.render(\n    \u003cDI injector={store}\u003e\n        \u003cC1 deps={{test1:'dep1',test2:'dep2'}} /\u003e\n        \u003cC2 deps={['test1','test2']}\u003e\n            \u003cC1 deps={['test1','test3']} /\u003e\n        \u003c/C2\u003e\n    \u003c/DI\u003e,div);\n\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhdev%2Fstrikejs-di","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhdev%2Fstrikejs-di","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhdev%2Fstrikejs-di/lists"}