Added unread indicator (#67), reply link back to original (#96)

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-12-03 18:32:10 +05:30
parent 0c0a978886
commit 38cbb87a62
21 changed files with 948 additions and 507 deletions

View file

@ -0,0 +1,8 @@
/* eslint-disable import/prefer-default-export */
import { useState } from 'react';
export function useForceUpdate() {
const [, setData] = useState(null);
return () => setData({});
}

22
src/app/hooks/useStore.js Normal file
View file

@ -0,0 +1,22 @@
/* eslint-disable import/prefer-default-export */
import { useEffect, useRef } from 'react';
export function useStore(...args) {
const itemRef = useRef(null);
const getItem = () => itemRef.current;
const setItem = (event) => {
itemRef.current = event;
return itemRef.current;
};
useEffect(() => {
itemRef.current = null;
return () => {
itemRef.current = null;
};
}, args);
return { getItem, setItem };
}