mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-db.git
synced 2026-09-21 16:52:02 -07:00
31 lines
847 B
JavaScript
31 lines
847 B
JavaScript
/*
|
|
Use cases for psf-memo-db.
|
|
*/
|
|
|
|
import ListRecentProfiles from './list-recent-profiles.js'
|
|
import ListRecentPosts from './list-recent-posts.js'
|
|
import ListPostsByAddr from './list-posts-by-addr.js'
|
|
|
|
class UseCases {
|
|
constructor (localConfig = {}) {
|
|
this.adapters = localConfig.adapters
|
|
if (!this.adapters) {
|
|
throw new Error('Adapters required when instantiating UseCases.')
|
|
}
|
|
|
|
this.listRecentProfiles = null
|
|
this.listRecentPosts = null
|
|
this.listPostsByAddr = null
|
|
}
|
|
|
|
async start () {
|
|
this.listRecentProfiles = new ListRecentProfiles({ adapters: this.adapters })
|
|
this.listRecentPosts = new ListRecentPosts({ adapters: this.adapters })
|
|
this.listPostsByAddr = new ListPostsByAddr({ adapters: this.adapters })
|
|
console.log('Use cases initialized.')
|
|
return true
|
|
}
|
|
}
|
|
|
|
export default UseCases
|