Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

From functor to function for ApolloInMemoryCache #25

Merged
merged 7 commits into from
Jan 21, 2018

Conversation

drejohnson
Copy link
Contributor

Use a function instead of a functor for inMemoryCache

@@ -34,11 +19,12 @@ type inMemoryCacheRestoreData = Js.Nullable.t(restoreData);
/* Bind the InMemoryCache class */
[@bs.module "apollo-cache-inmemory"]
[@bs.new]
external apolloInMemoryCache : inMemoryCacheObject => apolloCache =
external apolloInMemoryCache : 'a => apolloCache =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to type this instead of using generic type

Copy link
Contributor

@Gregoirevda Gregoirevda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thanks a lot! Will review/add during the week

@@ -67,7 +64,7 @@ module Client =
{
let apolloClient =
ReasonApollo.createApolloClient(
~cache=InMemoryCache.cache,
~cache=inMemoryCache /* restore method can be piped e.g. inMemoryCache |> restore(window.__APOLLO__) */,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome to also have the restore available in here

@Gregoirevda Gregoirevda merged commit 077d8d5 into apollographql:master Jan 21, 2018
@Gregoirevda Gregoirevda mentioned this pull request Jan 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants