File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
data/src/main/java/com/whyranoid/data/post Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class MyPostPagingDataSource @Inject constructor(
40
40
// 현재 페이지
41
41
val currentPage = params.key ? : db.collection(CollectionId .POST_COLLECTION )
42
42
.whereEqualTo(AUTHOR_ID , myUid)
43
- .limit(10 )
43
+ .limit(DATA_COUNT_PER_PAGE )
44
44
.get()
45
45
.await()
46
46
@@ -121,7 +121,7 @@ class MyPostPagingDataSource @Inject constructor(
121
121
// 마지막 스냅샷 이후 페이지 불러오기
122
122
val nextPage = db.collection(CollectionId .POST_COLLECTION )
123
123
.whereEqualTo(AUTHOR_ID , myUid)
124
- .limit(10 )
124
+ .limit(DATA_COUNT_PER_PAGE )
125
125
.startAfter(lastDocumentSnapshot)
126
126
.get()
127
127
.await()
@@ -139,4 +139,8 @@ class MyPostPagingDataSource @Inject constructor(
139
139
fun setMyUid (myUid : String ) {
140
140
this .myUid = myUid
141
141
}
142
+
143
+ companion object {
144
+ private const val DATA_COUNT_PER_PAGE = 10L
145
+ }
142
146
}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class PostPagingDataSource @Inject constructor(
39
39
// 현재 페이지
40
40
val currentPage = params.key ? : db.collection(POST_COLLECTION )
41
41
.orderBy(UPDATED_AT , Query .Direction .DESCENDING )
42
- .limit(10 )
42
+ .limit(DATA_COUNT_PER_PAGE )
43
43
.get()
44
44
.await()
45
45
@@ -120,7 +120,7 @@ class PostPagingDataSource @Inject constructor(
120
120
// 마지막 스냅샷 이후 페이지 불러오기
121
121
val nextPage = db.collection(POST_COLLECTION )
122
122
.orderBy(UPDATED_AT , Query .Direction .DESCENDING )
123
- .limit(10 ).startAfter(lastDocumentSnapshot)
123
+ .limit(DATA_COUNT_PER_PAGE ).startAfter(lastDocumentSnapshot)
124
124
.get()
125
125
.await()
126
126
@@ -133,4 +133,8 @@ class PostPagingDataSource @Inject constructor(
133
133
LoadResult .Error (e)
134
134
}
135
135
}
136
+
137
+ companion object {
138
+ private const val DATA_COUNT_PER_PAGE = 10L
139
+ }
136
140
}
You can’t perform that action at this time.
0 commit comments