This file contains hidden or 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 cats.effect.Async | |
import cats.implicits._ | |
import com.snowplowanalytics.lrumap._ | |
class MemoizedAsyncUnary[F[_], A, B](cacheSize: Int, private val fn: A => F[B]) | |
(implicit A: Async[F], H: cats.Hash[A]) { | |
private val cache = CreateLruMap[F, Int, B].create(cacheSize) | |
def lookup(arg: A): F[B] = { |
This file contains hidden or 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 React from 'react'; | |
import { withApollo } from 'react-apollo'; | |
import { logger } from '$utils'; | |
export default (Component, queryOptions, queryAfterMount = true) => withApollo( | |
class extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { data: { loading: true } }; | |
} |