Skip to content

Commit

Permalink
Revamp the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Feb 14, 2019
1 parent 59be3ba commit 7d4e944
Show file tree
Hide file tree
Showing 3 changed files with 536 additions and 142 deletions.
49 changes: 23 additions & 26 deletions fixtures/eslint/index.js
Expand Up @@ -4,29 +4,26 @@
// 2. "File > Add Folder to Workspace" this specific folder in VSCode with ESLint extension
// 3. Changes to the rule source should get picked up without restarting ESLint server



function Comment({
comment,
commentSource,
}) {
const currentUserID = comment.viewer.id;
const environment = RelayEnvironment.forUser(currentUserID);
const commentID = nullthrows(comment.id);
useEffect(() => {
const subscription = SubscriptionCounter.subscribeOnce(
`StoreSubscription_${commentID}`,
() =>
StoreSubscription.subscribe(
environment,
{
comment_id: commentID,
},
currentUserID,
commentSource
)
);
return () => subscription.dispose();
}, [commentID, environment, currentUserID, commentSource]);
}

function Comment({comment, commentSource}) {
const currentUserID = comment.viewer.id;
const environment = RelayEnvironment.forUser(currentUserID);
const commentID = nullthrows(comment.id);
useEffect(
() => {
const subscription = SubscriptionCounter.subscribeOnce(
`StoreSubscription_${commentID}`,
() =>
StoreSubscription.subscribe(
environment,
{
comment_id: commentID,
},
currentUserID,
commentSource
)
);
return () => subscription.dispose();
},
[commentID, environment, currentUserID, commentSource]
);
}

0 comments on commit 7d4e944

Please sign in to comment.