- 컨테이너 생성
docker create [image]
- 컨테이너 시작
docker create [image]
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheet } from 'styled-components';
export default class MyDocument extends Document {
static async getInitialProps(ctx: any) {
const { renderPage } = ctx;
const initialProps = await Document.getInitialProps(ctx);
const sheet = new ServerStyleSheet();
useEffect(() => {
const sse = new EventSource('[YOUR_SSE_ENDPOINT_URL]',
{ withCredentials: true });
function getRealtimeData(data) {
// process the data here,
// then pass it to state to be rendered
}
sse.onmessage = e => getRealtimeData(JSON.parse(e.data));
sse.onerror = () => {
const personProxy = new Proxy(person, {
get: (obj, prop) => {
if (!obj[prop]) {
console.log(
`Hmm.. this property doesn't seem to exist on the target object`
);
} else {
console.log(`The value of ${prop} is ${obj[prop]}`);
}
body { | |
... | |
overscroll-behavior: none; < = overscroll 바운스 액션 막아줌 | |
} |
const useInterval = (callback: Function, delay?: number | null) => {
const savedCallback = useRef<Function>(() => {});
useEffect(() => {
savedCallback.current = callback;
});
useEffect(() => {
if (delay !== null) {
```ts | |
import { render as renderComponent } from '@testing-library/react'; | |
import userEvent from '@testing-library/user-event'; | |
export const render = ( | |
ui: React.ReactElement, | |
options?: Parameters<typeof renderComponent>[1], | |
) => { | |
const user = userEvent.setup(); | |
const result = renderComponent(ui, options); |
grep -v master // master 제외 | |
<!-- local branch 삭제 패턴 --> | |
```bash | |
git branch | grep "" | grep -v master | xargs git branch -D | |
``` | |
<!-- remote branch 삭제 패턴 --> | |
```bash |