---
title: "Discussion on \"[TypeScript] 메타데이터 관리하기(with. WeakMap)\" | Hashnode"
description: "Discussion on \"[TypeScript] 메타데이터 관리하기(with. WeakMap)\". 특정 객체의 메타데이터를 관리하는 방법으로 Map을 떠올리는 것은 그렇게 어렵지 않을 것입니다. 객체를 키로, 메타데이터를 값으로 취급하면 쉽게 구현할 수 있을 것 같습니다. 하지만, 이 방법이 항상 사용할 수 있는 것은 아닙니다. 메타데이터의 생명 주기를 객체와 동일하게 유지하고 싶다고 합시다. 객체가 폐기되는 시점을 알아야 하겠지요? 그런데 이 시점이 가비지 수집 시점이라면 어떻게 하나요?\n이러한 문제의 해결책 중 하나는 WeakMap을 사..."
url: "https://hashnode.com/posts/typescript-metadata/66ca4142eec99fe266a4eda9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[TypeScript\] 메타데이터 관리하기(with. WeakMap)](https://koranidro.hashnode.dev/typescript-metadata?utm_source=hashnode&utm_medium=feed)

특정 객체의 메타데이터를 관리하는 방법으로 Map을 떠올리는 것은 그렇게 어렵지 않을 것입니다. 객체를 키로, 메타데이터를 값으로 취급하면 쉽게 구현할 수 있을 것 같습니다. 하지만, 이 방법이 항상 사용할 수 있는 것은 아닙니다. 메타데이터의 생명 주기를 객체와 동일하게 유지하고 싶다고 합시다. 객체가 폐기되는 시점을 알아야 하겠지요? 그런데 이 시점이 가비지 수집 시점이라면 어떻게 하나요? 이러한 문제의 해결책 중 하나는 WeakMap을 사...

Aug 24, 2024 · 1 min read · koranidro.hashnode.dev  
Updated Oct 11, 2024  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#metadata](https://hashnode.com/tag/metadata)
-   [#weakmap](https://hashnode.com/tag/weakmap)

## Written by

[고라니드로](https://hashnode.com/@koranidro)

@koranidro

  
[View profile](https://hashnode.com/@koranidro)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
