{"id":16559923,"url":"https://github.com/rbusarow/tangle","last_synced_at":"2025-10-17T01:10:43.350Z","repository":{"id":38183020,"uuid":"382741106","full_name":"RBusarow/Tangle","owner":"RBusarow","description":"Android injection using the Anvil compiler plugin","archived":false,"fork":false,"pushed_at":"2023-11-21T19:06:36.000Z","size":5151,"stargazers_count":88,"open_issues_count":27,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-12T20:27:34.580Z","etag":null,"topics":["android","anvil","dagger2","dependency-injection","kotlin"],"latest_commit_sha":null,"homepage":"https://rbusarow.github.io/Tangle/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RBusarow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-07-04T01:44:08.000Z","updated_at":"2024-04-18T15:01:28.000Z","dependencies_parsed_at":"2023-02-15T09:46:33.847Z","dependency_job_id":null,"html_url":"https://github.com/RBusarow/Tangle","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RBusarow%2FTangle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RBusarow%2FTangle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RBusarow%2FTangle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RBusarow%2FTangle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RBusarow","download_url":"https://codeload.github.com/RBusarow/Tangle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221667611,"owners_count":16860623,"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":["android","anvil","dagger2","dependency-injection","kotlin"],"created_at":"2024-10-11T20:27:34.072Z","updated_at":"2025-10-17T01:10:38.313Z","avatar_url":"https://github.com/RBusarow.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/com.rickbusarow.tangle/tangle-api?style=flat-square)](https://search.maven.org/search?q=com.rickbusarow.tangle)\n[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.rickbusarow.tangle?style=flat-square)](https://plugins.gradle.org/plugin/com.rickbusarow.tangle)\n[![License](https://img.shields.io/badge/license-apache2.0-blue?style=flat-square.svg)](https://opensource.org/licenses/Apache-2.0)\n\n___\n\nTangle creates [Dagger] bindings for Android classes using the [Anvil] Kotlin compiler plugin. This\nis meant to be an alternative to [Hilt], for those who'd prefer to enjoy the faster compilation and\nbetter flexibility of Anvil.\n\nSince Tangle is an extension upon Anvil, its code generation will be applied to **Kotlin** files\nonly.\n\n### Please see [the project website](https://rbusarow.github.io/Tangle/) for full documentation.\n\n## Features\n\n#### ViewModel Injection\n\n```kotlin\nclass MyViewModel @VMInject constructor(\n  val repository: MyRepository,\n  @TangleParam(\"userId\") // pulls the \"userId\" argument out of SavedStateHandle\n  val userId: String\n) : ViewModel()\n\n@Composable\nfun MyComposable(\n  navController: NavController,\n  viewModel: MyViewModel = tangleViewModel()\n) { /* ... */ }\n\nclass MyFragment : Fragment() {\n  val viewModel: MyViewModel by tangleViewModel()\n}\n```\nInject ViewModels, including scoped `SavedStateHandle` arguments. Use the `@TangleParam` annotation to automatically extract navigation/Bundle arguments and inject them directly. [read more](https://rbusarow.github.io/Tangle/docs/viewModels/viewModels)\n\n#### Fragment Injection with Bundle arguments\n\n```kotlin\n@ContributesFragment(AppScope::class)\nclass MyFragment @FragmentInject constructor(\n  val repository: MyRepository\n) : Fragment() {\n\n  val name: String by arg(\"name\")\n\n  @FragmentInjectFactory\n  interface Factory {\n    fun create(\n      @TangleParam(\"name\") name: String\n    ): MyFragment\n  }\n}\n```\n\nUse constructor injection in Fragments, with optional AssistedInject-like factories for type-safe `Bundle` arguments. Bindings are created automatically. [read more](https://rbusarow.github.io/Tangle/docs/next/fragments/fragments)\n\n#### Worker Injection\n\n```kotlin\n@TangleWorker\nclass MyWorker @AssistedInject constructor(\n  @Assisted context: Context,\n  @Assisted params: WorkerParameters\n) : CoroutineWorker(context,params) {\n  override suspend fun doWork(): Result {\n    /* ... */\n  }\n}\n```\n\nUse Dagger's `@AssistedInject` and `@Assisted` annotations and `@TangleWorker` to inject any `ListenableWorker`. [read more](https://rbusarow.github.io/Tangle/docs/next/workManager/workManager)\n\n## License\n\n``` text\nCopyright (C) 2021 Rick Busarow\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n     http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n\n[Anvil]: https://github.com/square/anvil\n\n[Dagger]: https://dagger.dev\n\n[Hilt]: https://dagger.dev/hilt/view-model.html\n\n[SavedStateHandle]: https://developer.android.com/topic/libraries/architecture/viewmodel-savedstate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbusarow%2Ftangle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbusarow%2Ftangle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbusarow%2Ftangle/lists"}