Skip to content

Instantly share code, notes, and snippets.

View Bertrand31's full-sized avatar

Bertrand Junqua Bertrand31

View GitHub Profile
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] = {
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 } };
}