Skip to content

Commit

Permalink
Merge pull request reasonml-community#56
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrolich committed Oct 24, 2019
1 parent 9e8f98c commit 97a31c6
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/ApolloHooksQuery.re
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,17 @@ let useQuery =
[|jsResult|],
);

(
switch (result) {
| {loading: true} => Loading
| {error: Some(error)} => Error(error)
| {data: Some(data)} => Data(data)
| _ => NoData
},
result,
);
let simple =
React.useMemo1(
() =>
switch (result) {
| {loading: true} => Loading
| {error: Some(error)} => Error(error)
| {data: Some(data)} => Data(data)
| _ => NoData
},
[|result|],
);

(simple, result);
};

0 comments on commit 97a31c6

Please sign in to comment.