You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: firestore_redux/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ In the present case, Firestore is being used but set up is similar.
82
82
83
83
## Summary of changes made to the original redux sample repo.
84
84
85
-
1. Added `firebase_flutter_repository` to the `pubspec.yaml`, removed `todos_repository_flutter`.
85
+
1. Added `firebase_flutter_repository` to the `pubspec.yaml`, removed `todos_repository_simple`.
86
86
2. Limit the responsibility of the Reducers since Firestore is the source of truth.
87
87
3. Change the Middleware to work with a `UserRepository` for auth and `ReactiveTodosRepository` to listen for changes to the Todos and push updates to Firestore.
88
88
4. Add Actions for Login and to Start Listening to Firestore. It's not needed in this app, but we could also add an action to stop listening to Firestore.
An app-agnostic data source that can be used by sample apps to fetch and persist data.
3
+
An app-agnostic data source that can be used by sample apps to fetch and persist data.
4
4
5
5
## Key Concepts
6
6
7
7
* Defines *what* can be fetched from the data layer
8
8
* Does not expose *how* the data is fetched and stored
9
-
* Should be consumed by the domain layer
10
-
9
+
* Should be consumed by the domain layer
10
+
11
11
## Defines *what* can be fetched from the data layer
12
12
13
-
The goal of the repository pattern is to provide an abstract interface to the data layer of your application. The Repository describes the entities that can be fetched and stored, but should not expose how those things happen.
13
+
The goal of the repository pattern is to provide an abstract interface to the data layer of your application. The Repository describes the entities that can be fetched and stored, but should not expose how those things happen.
14
14
15
15
The term "Data Layer" comes from the "Clean Architecture Pattern." In this pattern, we separate our app into layers. Each Layer should only talk to the layer after it.
16
16
@@ -22,14 +22,14 @@ The term "Data Layer" comes from the "Clean Architecture Pattern." In this patte
22
22
23
23
This library does not expose the in-memory, web client, or file storage mechanisms directly, but describes what an interface the domain layer can work with.
24
24
25
-
Concrete implementations, such as `todos_repository_flutter`, provide the actual mechanism for storing and retrieving data for the appropriate environment.
25
+
Concrete implementations, such as `todos_repository_simple`, provide the actual mechanism for storing and retrieving data for the appropriate environment.
26
26
27
27
This separation provides several benefits:
28
28
29
-
* We could change the underlying storage mechanism without requiring any of of the apps to change.
29
+
* We could change the underlying storage mechanism without requiring any of of the apps to change.
30
30
* We can control the the fallback logic in a central place. E.g. We first try to read todos from memory, then from disk, then from the web. We can always change the way this works in the concrete implementation.
31
31
* We can compose several different data sources together into a single, easy-to-consume Entity.
32
-
33
-
## Should be consumed by the domain layer
34
32
35
-
In order to maximize code sharing, the domain layer should be pure Dart and depend on the abstract classes defined in this library rather than concrete implementations. This allows the domain layer to be shared across different environments, such as Flutter and Web.
33
+
## Should be consumed by the domain layer
34
+
35
+
In order to maximize code sharing, the domain layer should be pure Dart and depend on the abstract classes defined in this library rather than concrete implementations. This allows the domain layer to be shared across different environments, such as Flutter and Web.
0 commit comments