Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 authored Dec 8, 2023
1 parent ed20a10 commit 4791556
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Instead, you have the "same key, same bean" rule:
Intuitively this means a component injects the same bean instance everywhere (unless of course you're using qualifiers or inject a provider).

If you want to re-use a bean across multiple components, or multiple instances of the same component, use a `@Factory` or a `@Builder` to pass it.
The component will then use the bean instance that was passed this way, and it will not create a new bean instance.
If you want to re-use a bean instance across multiple components, or multiple instances of the same component, use a `@Factory` or a `@Builder` to pass it around.
Component will prefer the bean instance that was passed this way, and it will not create a new bean instance.

If you inject `Provider<TheBean>`, rather than `TheBean` directly, calling `provider.get()` will create a fresh bean instance every time.

Expand Down

0 comments on commit 4791556

Please sign in to comment.