Skip to Content
자바스크립트 + 리액트 디자인 패턴
book

자바스크립트 + 리액트 디자인 패턴

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
240
자바스크립트 + 리액트 디자인 패턴
예제
10-9
CommonJS
모듈을
AMD
로 변환한 예시
// CommonJS 형식의 모듈을 AMD 형식으로 변경한 예시입니다.
define(function (require) {
var lib = require("package/lib");
// 모듈의 내부 로직을 정의합니다.
function foo() {
lib.log("hello world!");
}
// foo 함수를 외부로 내보냅니다.
return {
foobar: foo,
};
});
AMD
CommonJS
모듈 형식을 간편하게 변환할 수 있는 기능
27
을 지원하기에 가능한 코
드입니다.
10.3.2
여러 의존성 동시에 사용하기
app
.
js
예시
var modA = require("./foo");
var modB = require("./bar");
exports.app = function () {
console.log("Im an application!");
};
exports.foo = function () {
return modA.helloWorld();
};
27
https
://
requirejs
.
org
/
docs
/
whyamd
.
html
#
sugar
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI를 위한 필수 수학

AI를 위한 필수 수학

할라 넬슨
클라우드 엔지니어를 위한 97가지 조언

클라우드 엔지니어를 위한 97가지 조언

Emily Freeman, Nathen Harvey, 정기훈(Jung Ki Hun)

Publisher Resources

ISBN: 9791169212571