mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 11:10:11 +08:00
feat: add sorting order
This commit is contained in:
1 parent
1b94ae75ca
commit
c6733814ba
3 files changed
+39
-7
No files matched your search
@@ -0,0 +1,23 @@
|
||||
/* eslint-disable class-methods-use-this */
|
||||
// eslint-disable-next-line max-classes-per-file
|
||||
class Order {}
|
||||
|
||||
export class Asc extends Order {
|
||||
matchStage(nextKey) {
|
||||
return { $gt: nextKey }
|
||||
}
|
||||
|
||||
order() {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
export class Desc extends Order {
|
||||
matchStage(nextKey) {
|
||||
return { $lt: nextKey }
|
||||
}
|
||||
|
||||
order() {
|
||||
return -1
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user