export const confirm = (config: ConfirmDialogProps) =>
factory({ ...config, Component: ConfirmDialog });export const destroyFns: Array<() => void> = [];
export const destroyAll = () => {
while (destroyFns.length) {
const close = destroyFns.pop();
if (close) {
close();
}
}export interface ConfirmProps {
afterClose?: () => void;
onClickClose?: (
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
) => void;
onOk?: (
event:
| React.MouseEvent<HTMLButtonElement, MouseEvent>const useModal = (
isVisible: boolean
): [
boolean,
React.Dispatch<React.SetStateAction<boolean>>,
(event: React.KeyboardEvent<any>) => void
] => {
const [isOpen, setIsOpen] = useState(isVisible);interface Factory {
Component?: any;
onClosed?: () => void;
onAfterClosed?: () => void;
[x: string]: any;
}
export const factory = ({ Component, ...config }: Factory) => {
const div = document.createElement("div"); import "bootstrap/dist/css/bootstrap.min.css";
export default function confirm(config: ModalFuncProps) {
const div = document.createElement('div');
document.body.appendChild(div);
// eslint-disable-next-line no-use-before-define
let currentConfig = { ...config, close, visible: true } as any;
function render({ okText, cancelText, prefixCls, ...props }: any) {
/**
* https://github.com/ant-design/ant-design/issues/23623const initialState: State = {
user: {
id: '',
nickname: '',
photoURL: '',
statusMessage: '',
},
deleteMode: false,
// ref๋ฅผ ์ฃผ์
๋ฐ์ modal state์
๋๋ค.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <head> | |
| <title>threejs - basic setup</title> | |
| </head> | |
| <body> | |
| <canvas id ="c"></canvas> | |
| </body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ์บ์ | |
| ์ฐธ๊ณ : https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=ko | |
| 1. CDN์์๋ ์ด๋ค ๋ฐ์ดํฐ๋ฅผ ์บ์ํ๋๊ฐ? | |
| api์ content-type์ ๋ฐ๋ผ์ (image, pdf, js, css, html ๋ฑ๋ฑ...) | |
| ์ฃผ์: CDN์ด ๋ฐ์ดํฐ๋ฅผ ์บ์ํ๊ธฐ ๋๋ฌธ์ ์ํ๋ ๋์ ์ต์ ํ๋ ๋ฐ์ดํฐ๊ฐ ์ค์ง ์์ฌ ์ ์์ผ๋ฏ๋ก ์ฃผ์๊ฐ ํ์ํ๋ค. | |
| 2. ์ด๋ป๊ฒ ํด์ผ ์บ์ ๋ฐ์ดํฐ๋ฅผ ์ง์ ํ ์ ์๋๊ฐ? | |
| HTTP ํด๋ ์ค์ (ETag, Cache-Control) | |
| ์ฐธ๊ณ : https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 |