Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Provides
- @Singleton
- @JvmStatic
- internal fun provideHuntPersister(application: Application): Persister<BufferedSource, BarCode> =
- FileSystemPersisterFactory.create(application.cacheDir,
- { barCode: BarCode -> barCode.type + "/" + barCode.key })
- @Provides
- @Singleton
- @JvmStatic
- internal fun provideHuntStore(api: HuntAPI, moshi: Moshi,
- persister: Persister<BufferedSource, BarCode>):
- Store<Hunt, BarCode> = StoreBuilder.parsedWithKey<Barcode, BufferedSource, Data>()
- .fetcher {api.getData(it.key) }
- .parsers(MoshiParserFactory.createSourceParser<Data>(moshi, Data::class.java))
- .persister(persister)
- .open()
Add Comment
Please, Sign In to add comment