-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Translate 1 file to ko - Uncalled Function Checks #1511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
github-actions
merged 2 commits into
microsoft:v2
from
yahma25:Translation-to-ko-playground-Uncalled-Function-Checks
Jan 31, 2021
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
packages/playground-examples/copy/ko/3-7/Types and Code Flow/Uncalled Function Checks.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//// { compiler: { }, order: 1 } | ||
|
||
// 3.7버전에서 새로운 점은 | ||
// 여러분이 함수의 반환 값 대신 실수로 함수를 사용할 때, | ||
// if문 내부를 검사하는 것입니다. | ||
|
||
// if문을 항상 true로 만드는 함수가 존재한다고 | ||
// 알려질 때만 적용합니다. | ||
|
||
// 여기에 선택적인 콜백과 필수적인 콜백이 있는 | ||
// plugin 인터페이스 예시가 있습니다. | ||
|
||
interface PluginSettings { | ||
pluginShouldLoad?: () => void; | ||
pluginIsActivated: () => void; | ||
} | ||
|
||
declare const plugin: PluginSettings; | ||
|
||
// pluginShouldLoad는 존재하지 않으니 | ||
// 타당한 검사입니다. | ||
|
||
if (plugin.pluginShouldLoad) { | ||
// pluginShouldLoad가 존재할 때 이곳에 당신이 원하는 것을 하세요. | ||
} | ||
|
||
// 3.6버전과 아래의 경우, 에러가 아닙니다. | ||
|
||
if (plugin.pluginIsActivated) { | ||
// plugin이 활성화 될때 | ||
// 무언가를 하고 싶지만, | ||
// 메서드 호출하는 대신에 속성으로 사용했습니다. | ||
} | ||
|
||
// pluginIsActivated는 항상 존재해야 하지만, | ||
// if문 블록 안에서 메서드를 호출했으므로 | ||
// TypeScript는 여전히 검사를 허용합니다. | ||
|
||
if (plugin.pluginIsActivated) { | ||
plugin.pluginIsActivated(); | ||
} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.