Rename Log.js to log.js

This commit is contained in:
2019-08-22 23:56:59 +02:00
committed by GitHub
parent 6ad47ca2b2
commit 849c8ca1ba

View File

@@ -0,0 +1,18 @@
import { useEffect, useState } from 'react';
const useLog = (provider) => {
const [logs, setLogs] = useState([]);
useEffect(() => {
const update = (newLogs) => {
setLogs([...newLogs]);
}
provider.listen(update);
return () => {
provider.unlisten(update);
}
}, []);
return logs;
};
export default useLog;