{"id":24084566,"url":"https://github.com/oleystack/context","last_synced_at":"2025-02-27T02:19:01.993Z","repository":{"id":136410361,"uuid":"612361572","full_name":"oleystack/context","owner":"oleystack","description":"⚙️ React's Context-related utils.","archived":false,"fork":false,"pushed_at":"2023-07-20T07:45:15.000Z","size":372,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T14:13:33.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/oleystack.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,"governance":null}},"created_at":"2023-03-10T19:19:18.000Z","updated_at":"2023-04-30T21:02:40.000Z","dependencies_parsed_at":"2023-07-25T20:59:22.163Z","dependency_job_id":null,"html_url":"https://github.com/oleystack/context","commit_stats":null,"previous_names":["oleystack/context","bit-about/context"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleystack%2Fcontext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleystack%2Fcontext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleystack%2Fcontext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleystack%2Fcontext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleystack","download_url":"https://codeload.github.com/oleystack/context/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240964505,"owners_count":19885758,"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":"2025-01-10T00:37:59.577Z","updated_at":"2025-02-27T02:19:01.966Z","avatar_url":"https://github.com/oleystack.png","language":"TypeScript","funding_links":["https://github.com/sponsors/macoley"],"categories":[],"sub_categories":[],"readme":"\r\n\u003cp align=\"center\" style=\"font-weight: bold; font-size: 1.5em\"\u003e@bit-about/context\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n\u003ca href=\"https://www.npmjs.com/package/@bit-about/context\"\u003e\u003cimg alt=\"\" src=\"https://img.shields.io/npm/v/@bit-about/context.svg\" /\u003e\u003c/a\u003e\r\n\u003ca href=\"https://bundlephobia.com/package/@bit-about/context\"\u003e\u003cimg alt=\"Bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@bit-about/context?label=size\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n## Install\r\n\r\n```bash\r\nnpm i @bit-about/context\r\n```\r\n\r\n## Description\r\n\r\nAimed at delivering context-related utils for @bit-about libraries. \r\n\r\n- 100% **Idiomatic React** and 100% Typescript\r\n- Tiny \u0026 Efficient\r\n- Does not trigger unnecessary renderings\r\n- as always, **Just works** ™\r\n\r\n## Usage\r\n\r\n```tsx\r\nimport { createContext, useContextSelector } from '@bit-about/context'\r\n\r\ninterface State {\r\n  alice: number;\r\n  bob: number;\r\n}\r\n\r\nconst defaultValue: State = {\r\n  alice: 1,\r\n  bob: 2\r\n}\r\n\r\nconst Context = createContext\u003cState\u003e(defaultValue)\r\n\r\nconst App = () =\u003e (\r\n  \u003cContext.Provider value={defaultValue}\u003e\r\n    \u003cComponent /\u003e\r\n  \u003c/Context.Provider\u003e\r\n)\r\n\r\nconst Component = () =\u003e {\r\n  const bob = useContextSelector(Context, (state) =\u003e state.bob)\r\n\r\n  return bob // returns \"2\"\r\n}\r\n```\r\n\r\n\r\n\r\n## Partners  \r\n\u003ca href=\"https://www.wayfdigital.com/\"\u003e\u003cimg alt=\"wayfdigital.com\" width=\"100\" height=\"100\" src=\"https://user-images.githubusercontent.com/1496580/161037415-0503f763-a60b-4d40-af9f-95d1304fa486.png\"/\u003e\u003c/a\u003e\r\n\r\n## Credits\r\n- [use-context-selector](https://github.com/dai-shi/use-context-selector) \u0026 [FluentUI](https://github.com/microsoft/fluentui) - fancy re-render avoiding tricks and code main inspiration\r\n\r\n## License\r\nMIT © [Maciej Olejnik 🇵🇱](https://github.com/macoley)\r\n\r\n## Support me \r\n\r\n\u003ca href=\"https://github.com/sponsors/macoley\"\u003e\u003cimg alt=\"Support me!\" src=\"https://img.shields.io/badge/github.com-Support%20me!-green\"/\u003e\u003c/a\u003e\r\n\r\nIf you use my library and you like it...\u003cbr /\u003e\r\nit would be nice if you put the name `BitAbout` in the work experience section of your resume.\u003cbr /\u003e\r\nThanks 🙇🏻! \r\n\r\n\r\n---\r\n\u003cp align=\"center\"\u003e🇺🇦 Slava Ukraini\u003c/p\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleystack%2Fcontext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleystack%2Fcontext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleystack%2Fcontext/lists"}