Skip to content

Commit

Permalink
Reframe text and change its order
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-plavsic committed Jan 29, 2025
1 parent a2f3ef9 commit 78996c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/content/docs/core/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ There are also two optional named parameters that can be specified.
| Parameter | Default | Description |
| -------------- | ------- | ----------- |
| `dispose` | null | The function to call when the scope containing the provider gets disposed. It is used to dispose correctly the value held by the provider. |
| `lazy` | `DiscoConfig.lazy`, which defaults to true | The values of the providers provided in a scope are created lazily.|
| `lazy` | `DiscoConfig.lazy`, which defaults to true | The provider's value is created lazily, meaning it is only created when first injected.|
4 changes: 2 additions & 2 deletions docs/src/content/docs/core/scoped-di.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ ProviderScope(

Injecting is the act of retrieving a dependency. It is done with the methods `of(context)` and `maybeOf(context)`, the latter one being safer because it returns null instead of throwing if the provider is not found in any scopes.

In full example below, we are going to inject the two providers above with `numberProvider.of(context)` and `doubleNumberPlusArgProvider.of(context)`.

<Aside type="tip">
If you are unsure about which one to use, for simplicity you should probably stick to `of(context)`.
</Aside>

We inject the two providers above by using the `numberProvider.of(context)` and `doubleNumberPlusArgProvider.of(context)`.

<Aside>
Users transitioning from Provider or Riverpod should note an important distinction: this library does not include reactivity. Therefore, it does not provide equivalents to `context.watch`/`context.listen` or `ref.watch`/`ref.listen`. The only way to trigger a rebuild is by changing the key of the `ProviderScope`, which is not recommended by us. Instead, we advise injecting observables/signals directly and using their corresponding widgets or helpers to react to changes.
</Aside>
Expand Down

0 comments on commit 78996c3

Please sign in to comment.