Skip to content

Commit

Permalink
Mention that global state solutions usually use extra objects to mana…
Browse files Browse the repository at this point in the history
…ge state
  • Loading branch information
manuel-plavsic committed Jan 27, 2025
1 parent dd03b50 commit d7afcf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The pros of Disco are:
- There is no need to create wrapper types or rely on IDs such as strings.
- The API is very simple and feels natural to Flutter.
- Providers are equipped with `of(context)` and `maybeOf(context)` methods.
- All you need is `BuildContext`. There is no additional object needed to manage the state.
- The removal of a provider has an impact on its providing and each of its injections.
- Each of them is immediately characterized by a static error.
- The values held by the providers are immutable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ Due to the limitations mentioned earlier, the Flutter ecosystem saw the emergenc

However, they introduce new challenges:

- Be able to access everything from everywhere, which can lead to spaghetti code.
- **Circular dependencies**
- **Unrestricted access**
- Being able to access everything from everywhere can lead to spaghetti code.
- **Circular dependencies**
- **Local-state-like logic** that doesn't behave exactly like real local state
- This complicates logic, especially for beginners.
- Sometimes it feels like you're fighting against the framework.
- This complicates the logic, especially for beginners.
- Some solution require objects of special classes to manage the global state.
- Passing these objects around (instead of passing `BuildContext` instances around) creates inconsistencies and can feel like working against the framework.
- **Code generation** in some packages
- It should not be necessary.
- Creates a high learning curve for new developers.
Expand Down

0 comments on commit d7afcf3

Please sign in to comment.