Created
May 14, 2015 09:54
-
-
Save Lovesan/7fb635bb51a20d51dffd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private def metaExists(id: Id[DocumentMeta]): Rx[Boolean] = { | |
metaDir.fileExists(id.value) mapToRx { | |
case Failure(_) => false | |
case Success(exists) => exists | |
} | |
} | |
private def dataExists(id: Id[DocumentMeta]): Rx[Boolean] = { | |
dir.fileExists(id.value) mapToRx { | |
case Failure(_) => false | |
case Success(exists) => exists | |
} | |
} | |
private def getPendingMeta(id: Id[DocumentMeta])(f: => Rx[CdnMetaState]) = { | |
pendingMeta.getOrElseUpdate(id, f) | |
} | |
private def getPendingData(id: Id[DocumentMeta])(f: => Rx[CdnDataState]) = { | |
pendingData.getOrElseUpdate(id, f) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment