1. // This is a testing playground for our lint rules.
    
  2. 
    
  3. // 1. Run yarn && yarn start
    
  4. // 2. "File > Add Folder to Workspace" this specific folder in VSCode with ESLint extension
    
  5. // 3. Changes to the rule source should get picked up without restarting ESLint server
    
  6. 
    
  7. function Comment({comment, commentSource}) {
    
  8.   const currentUserID = comment.viewer.id;
    
  9.   const environment = RelayEnvironment.forUser(currentUserID);
    
  10.   const commentID = nullthrows(comment.id);
    
  11.   useEffect(() => {
    
  12.     const subscription = SubscriptionCounter.subscribeOnce(
    
  13.       `StoreSubscription_${commentID}`,
    
  14.       () =>
    
  15.         StoreSubscription.subscribe(
    
  16.           environment,
    
  17.           {
    
  18.             comment_id: commentID,
    
  19.           },
    
  20.           currentUserID,
    
  21.           commentSource
    
  22.         )
    
  23.     );
    
  24.     return () => subscription.dispose();
    
  25.   }, [commentID, commentSource, currentUserID, environment]);
    
  26. }