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
if (window.ethereum) { | |
window.web3 = new Web3(ethereum) | |
try { | |
// Request account access if needed | |
await ethereum.enable() | |
} catch (error) { | |
console.log(error) | |
} | |
} |
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
Flux.concat(dao.findIds() // ADDED: Flux.concat | |
.doOnNext { id: String -> | |
LOGGER.info { "[findIds] $id" } | |
} | |
.map { id: String -> // WAS: flatMap | |
dao.getDocById(id) | |
.doOnSubscribe { | |
LOGGER.info { "before getDocById: $id" } | |
}.doOnSuccess { | |
LOGGER.info { "after getDocById: $it" } |
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
dao.findIds() | |
.doOnNext { id: String -> | |
LOGGER.info { "[findIds] $id" } | |
} | |
.flatMap { id: String -> | |
dao.getDocById(id) | |
.doOnSubscribe { | |
LOGGER.info { "before getDocById: $id" } | |
}.doOnSuccess { | |
LOGGER.info { "after getDocById: $it" } |
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
import sys | |
# From http://stackoverflow.com/a/1988826/3756789 | |
class Memoize: | |
def __init__(self, f): | |
self.f = f | |
self.memo = {} | |
def __call__(self, *args): |