image
Akan.js
한국어
문서컨벤션레퍼런스Cheatsheet
image
Akan.js
Akan.js v2 문서가 새로 나왔습니다.v1 문서 보기
문서컨벤션레퍼런스Cheatsheet
MIT 라이선스 하에 배포되었습니다.
Akan.js 공식 컨설팅 서비스Akansoft
Copyright © 2026 Akan.js 모든 권리 보유.
시스템 관리자bassman
워크스페이스 규칙
• 구조
• 포맷 & 린트
앱 & 라이브러리 규칙
• 애셋 (public/ private/)
• 컴포넌트 (ui/)
• 서버 유틸리티 (srvkit/)
• 웹 유틸리티 (webkit/)
• 공통 유틸리티 (common/)
• akan.config.ts
도메인 규칙
• 개요
• model.constant.ts
• model.dictionary.ts
• model.document.ts
• model.service.ts
• model.signal.ts
• model.store.ts
• Model.Template.tsx
• Model.Unit.tsx
• Model.Util.tsx
• Model.View.tsx
• Model.Zone.tsx
스칼라 규칙
• 개요
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
서비스 규칙
• 개요
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
워크스페이스 규칙
• 구조
• 포맷 & 린트
앱 & 라이브러리 규칙
• 애셋 (public/ private/)
• 컴포넌트 (ui/)
• 서버 유틸리티 (srvkit/)
• 웹 유틸리티 (webkit/)
• 공통 유틸리티 (common/)
• akan.config.ts
도메인 규칙
• 개요
• model.constant.ts
• model.dictionary.ts
• model.document.ts
• model.service.ts
• model.signal.ts
• model.store.ts
• Model.Template.tsx
• Model.Unit.tsx
• Model.Util.tsx
• Model.View.tsx
• Model.Zone.tsx
스칼라 규칙
• 개요
• scalar.constant.ts
• scalar.dictionary.ts
• scalar.document.ts
• Scalar.Template.tsx
• Scalar.Unit.tsx
서비스 규칙
• 개요
• service.dictionary.ts
• service.service.ts
• service.signal.ts
• service.store.ts
• Service.Util.tsx
• Service.Zone.tsx
이전
scalar.dictionary.ts
다음
Scalar.Template.tsx

scalar.document.ts

scalar document 파일은 선택 사항입니다. scalar 값이 자기 field를 읽고 유용한 결과를 반환하는 작은 method를 필요로 할 때 추가합니다.
scalar에 field와 label만 필요하다면 constant와 dictionary 파일만으로 충분할 수 있습니다.

기본 wrapper

constant 파일을 `cnst`로 import한 뒤 constant class를 `by(cnst.Price)`로 감쌉니다. 이렇게 하면 document class가 constant class와 같은 field를 가집니다.
price.document.ts

작은 helper 예시

유용한 scalar document method는 보통 짧습니다. scalar field를 읽고 표시 값, boolean, 작은 계산 결과를 반환합니다.
price.document.ts

사용하는 경우

같은 표시나 계산이 여러 곳에 반복된다면 scalar document method를 사용합니다. 예를 들어 `Price.getLabel()`은 product card, order summary, invoice에서 재사용할 수 있습니다.
  • 좋음: `amount`와 `currency`로 price label을 formatting.
  • 좋음: `city`와 `street`로 address 요약.
  • 피하기: scalar method에서 다른 record를 load하거나 backend service를 호출.
scalar.document.ts
기본 wrapper
작은 helper 예시
사용하는 경우