2019-01-17 07:52:33 +08:00
|
|
|
// This is a testing playground for our lint rules.
|
|
|
|
|
|
|
|
// 1. Run yarn && yarn start
|
|
|
|
// 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
|
|
|
|
|
2019-02-21 02:18:58 +08:00
|
|
|
function Comment({comment, commentSource}) {
|
|
|
|
const currentUserID = comment.viewer.id;
|
|
|
|
const environment = RelayEnvironment.forUser(currentUserID);
|
|
|
|
const commentID = nullthrows(comment.id);
|
2020-01-09 21:54:11 +08:00
|
|
|
useEffect(() => {
|
|
|
|
const subscription = SubscriptionCounter.subscribeOnce(
|
|
|
|
`StoreSubscription_${commentID}`,
|
|
|
|
() =>
|
|
|
|
StoreSubscription.subscribe(
|
|
|
|
environment,
|
|
|
|
{
|
|
|
|
comment_id: commentID,
|
|
|
|
},
|
|
|
|
currentUserID,
|
|
|
|
commentSource
|
|
|
|
)
|
|
|
|
);
|
|
|
|
return () => subscription.dispose();
|
|
|
|
}, [commentID, commentSource, currentUserID, environment]);
|
2019-01-17 07:52:33 +08:00
|
|
|
}
|