Skip to content

Commit

Permalink
middleware example: Refactor the archtiecture of store to fit the lat…
Browse files Browse the repository at this point in the history
…est design guide
  • Loading branch information
benlau committed Apr 17, 2017
1 parent f83cf88 commit 7df0a3d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
10 changes: 5 additions & 5 deletions examples/middleware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Photo Album Example (middleware)

Purpose: Demonstrate the use of Middleware

/actions - ActionTypes and ActionCreator
/stores - Store
/middlewares - Middlewares
/components - Dump UI components (Have no app dependencies. Receive only props, providing data and signal)
/views - Smart UI Components (Receive data from Store and call actions)
/actions - ActionTypes and ActionCreator
/stores - Store
/middlewares - Middlewares
/components - Dump UI components (Have no app dependencies. Receive only props, providing data and signal)
/views - Smart UI Components (Receive data from Store and call actions)
3 changes: 2 additions & 1 deletion examples/middleware/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<file>main.qml</file>
<file>actions/AppActions.qml</file>
<file>actions/qmldir</file>
<file>stores/PhotoStore.qml</file>
<file>stores/qmldir</file>
<file>views/ImageViewer.qml</file>
<file>actions/ActionTypes.qml</file>
<file>views/StackView.qml</file>
<file>middlewares/ImagePickerMiddleware.qml</file>
<file>middlewares/NavigationMiddleware.qml</file>
<file>components/ImagePreview.qml</file>
<file>stores/RootStore.qml</file>
<file>stores/MainStore.qml</file>
</qresource>
</RCC>
5 changes: 5 additions & 0 deletions examples/middleware/stores/MainStore.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma Singleton
import QtQuick 2.0

RootStore {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pragma Singleton
import QtQuick 2.0
import QuickFlux 1.1
import "../actions"
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/stores/qmldir
Original file line number Diff line number Diff line change
@@ -1 +1 @@
singleton PhotoStore 1.0 PhotoStore.qml
singleton MainStore 1.0 MainStore.qml
2 changes: 1 addition & 1 deletion examples/middleware/views/ImageViewer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Rectangle {
spacing: 0

Repeater {
model: PhotoStore.photoModel
model: MainStore.photoModel
delegate: Image {
width: viewer.width / 3
height: width / 4 * 3
Expand Down

0 comments on commit 7df0a3d

Please sign in to comment.