{"id":25732243,"url":"https://github.com/howprogrammingworks/mixin","last_synced_at":"2025-05-07T18:45:19.128Z","repository":{"id":147758469,"uuid":"68866787","full_name":"HowProgrammingWorks/Mixin","owner":"HowProgrammingWorks","description":"Mixin behavior, structure and relations","archived":false,"fork":false,"pushed_at":"2023-11-06T17:00:25.000Z","size":28,"stargazers_count":7,"open_issues_count":1,"forks_count":21,"subscribers_count":18,"default_branch":"master","last_synced_at":"2023-11-07T01:03:27.848Z","etag":null,"topics":["javascript","js","mix","mixin","node","nodejs","object-assign"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/TimurShemsedinov","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/HowProgrammingWorks.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":"2016-09-21T23:43:58.000Z","updated_at":"2023-04-21T17:05:49.000Z","dependencies_parsed_at":"2023-11-07T01:07:14.680Z","dependency_job_id":null,"html_url":"https://github.com/HowProgrammingWorks/Mixin","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HowProgrammingWorks%2FMixin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HowProgrammingWorks%2FMixin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HowProgrammingWorks%2FMixin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HowProgrammingWorks%2FMixin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HowProgrammingWorks","download_url":"https://codeload.github.com/HowProgrammingWorks/Mixin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788734,"owners_count":19857691,"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":["javascript","js","mix","mixin","node","nodejs","object-assign"],"created_at":"2025-02-26T03:40:04.053Z","updated_at":"2025-02-26T03:40:04.794Z","avatar_url":"https://github.com/HowProgrammingWorks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Примеси в JavaScript\n\n[![Примеси в JavaScript: mixin, extend, Object.assign, class λ-mixin](https://img.youtube.com/vi/NZMrJ2adEyY/0.jpg)](https://www.youtube.com/watch?v=NZMrJ2adEyY)\n\nTasks:\n- see examples\n- implement `extend(obj, ...objects)` so keys from objects will be mixed into obj only if it doesn't contain those keys\n- implement `wrap(obj, ...funcs)` so if obj contains func.name it should be wrapped\n- implement mixin `logable()`\n- implement universal `equilateral` mixin for for N sides (see `6-class.js`)\n- implement `emitable` with `Object.defineProperty` (see `6-evants.js`)\n- implement mixin for prototypes (not instances)\n- implement `extend` for mixins with additional `override:Boolean` flag\n```js\nconst mix2 = [\n  {\n    override: true,\n    toString() {\n      return `${this.name} - ${this.city} - ${this.born}`;\n    }\n  },\n  {\n    override: false,\n    age() {\n      const year = new Date().getFullYear();\n      const born = new Date(this.born).getFullYear();\n      return year - born;\n    }\n  }\n];\n\nextend(obj1, mix1, mix2);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowprogrammingworks%2Fmixin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowprogrammingworks%2Fmixin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowprogrammingworks%2Fmixin/lists"}