Skip to content
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

[docs/korean] Translate official document to Korean #18

Merged
merged 83 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
c3e5e3a
Create installation_kr.md and translated installation_kr to Korean
alstn2468 May 15, 2020
5b00cc6
Seperate korean translation folder (docs/docs_kr)
alstn2468 May 15, 2020
287b70c
Translate introduction/gettsing-started.mdx to Korean
alstn2468 May 15, 2020
409a8bc
Fix miss typo at docs/krgetting-started.mdx
alstn2468 May 15, 2020
0f4a34a
Fix missing [] at getting-started.mdx -> CRA
alstn2468 May 15, 2020
747578c
Translate docs_kr/basic_tutorial/intro.md to Korean
alstn2468 May 15, 2020
c2a1768
Translate docs_kr/basic_tutorial/atoms.mdx
alstn2468 May 15, 2020
e9b9108
Remove english line at atoms.mdx
alstn2468 May 15, 2020
2bc7076
Remove english line at atoms.mdx
alstn2468 May 15, 2020
7baf77e
Fix miss typo at atoms.mdx
alstn2468 May 15, 2020
a1a3793
Fix miss typo at installation.d & gettig-started.mdx
alstn2468 May 16, 2020
3ee2c60
Translate docs_kr/basic_tutorial/selectors.md
alstn2468 May 16, 2020
b0b8875
Fix miss typo at basic-tutorial/performance.md line 60
alstn2468 May 17, 2020
b6ff106
Translate performace.md to Korean
alstn2468 May 17, 2020
e9043d0
Translate core-concepts to Korean
alstn2468 May 17, 2020
d68f5e6
Fix core-concepts
alstn2468 May 17, 2020
4f3ef50
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 May 19, 2020
732c44b
Apply lately document from docs to docs_kr
alstn2468 May 19, 2020
646fde6
Fix miss typo at docs_kr - performance section
alstn2468 May 25, 2020
3b58fc6
[docs/kr] Translate introduction/motivation.md
alstn2468 Jun 4, 2020
ff04586
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Jun 15, 2020
c0650ca
Add installation ESLint docs korean verstion
alstn2468 Jun 15, 2020
aca8fb7
Translate installation code block comment to Korean
alstn2468 Jun 15, 2020
c1b3dbd
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Jul 17, 2020
c24921f
Apply recent changes at selectors.md
alstn2468 Jul 17, 2020
0ccd52f
Apply recent changes at installation.md
alstn2468 Jul 17, 2020
c6e24fb
Translate api-reference/core/RecoilRoot.md
alstn2468 Jul 17, 2020
362198e
Translate sub title at RecoilRoot
alstn2468 Jul 17, 2020
9c91af0
Translate api-reference/core/atom
alstn2468 Jul 17, 2020
1775d95
Translate api-reference/core/selector
alstn2468 Jul 27, 2020
7ff97d6
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Aug 18, 2020
879a691
Translate api-reference/core/isRecoilValue
alstn2468 Aug 18, 2020
b3dc9fd
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Sep 11, 2020
a925dc8
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Oct 20, 2020
6d9fbc2
Sync upstream docs to docs_kr
alstn2468 Oct 20, 2020
fef1a35
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Nov 3, 2020
5951804
Sync installation.md
alstn2468 Nov 3, 2020
328c43d
Sync atomFamily.md
alstn2468 Nov 3, 2020
a4b3b87
Sync atom, guides and translate additional atom.md
alstn2468 Nov 3, 2020
4e07591
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Nov 13, 2020
2908ba8
Sync asynchronous-data-queries, testing, core-concepts
alstn2468 Nov 13, 2020
b39e246
Fix typo in intro & performance
cos18 Nov 30, 2020
6c20fc7
Merge remote-tracking branch 'upstream/docs' into docs
alstn2468 Apr 5, 2021
36fa13c
Init docusaurus i18n config
alstn2468 Apr 5, 2021
24e9649
Fix locale kr -> ko
alstn2468 Apr 5, 2021
da727f0
Translated: Snapshot.md is now translated into Korean
Mark-Yoo Apr 5, 2021
e2abe8a
Translated: useGotoRecoilSnapshot.md is now translated into Korean
Mark-Yoo Apr 5, 2021
109c465
Translated: Lodable.md is now translated into Korean
Mark-Yoo Apr 5, 2021
22954c3
Translated: useRecoilCallback.md is now translated into Korean
Mark-Yoo Apr 5, 2021
2c6a503
Translated: useRecoilSnapshot.md is now translated into Korean
Mark-Yoo Apr 5, 2021
88cf0f9
Translated: useRecoilState.md is now translated into Korean
Mark-Yoo Apr 5, 2021
f2e1397
Translated: useRecoilStateLoadable.md is now translated into Korean
Mark-Yoo Apr 5, 2021
e0cbf2f
Translated: useRecoilTransactionObserver.md is now translated into Ko…
Mark-Yoo Apr 5, 2021
7d2eb8f
Translated: useRecoilValue.md is now translated into Korean
Mark-Yoo Apr 5, 2021
776cdbf
Translated: useRecoilValueLoadable.md is now translated into Korean
Mark-Yoo Apr 5, 2021
2a27f52
Translated: useResetRecoilState.md is now translated into Korean
Mark-Yoo Apr 5, 2021
a239d37
Translated: useSetRecoilState.md is now translated into Korean
Mark-Yoo Apr 5, 2021
25ecd63
Translated: asynchronous-data-queries.md is now translated into Korean
Mark-Yoo Apr 5, 2021
f65ccee
Translated: atom-effects.md is now translated into Korean
Mark-Yoo Apr 5, 2021
24e6a9e
Translated: dev-tools.md is now translated into Korean
Mark-Yoo Apr 5, 2021
c67a3cd
Translated: testing.md is now translated into Korean
Mark-Yoo Apr 5, 2021
f399004
Sync docs
alstn2468 Apr 5, 2021
3a56dc1
Add useGetRecoilValueInfo.md to ko/api-reference/core
alstn2468 Apr 5, 2021
545d796
Translated: noWait.md is now translated into korean
Apr 6, 2021
4693916
Translated: waitForAny.md is now translated into korean
Apr 6, 2021
c7c7e0c
Translated: waitForAll.md is now translated into korean
Apr 6, 2021
35d996a
Translated: waitForNone.md is now translated into korean
Apr 6, 2021
7980d66
Translated: errorSelector.md is now translated into korean
Apr 6, 2021
3f2ae16
Translated: constSelector.md is now translated into korean
Apr 6, 2021
df49239
Translated: selectorFamily.md is now translated into korean
Apr 6, 2021
fe51533
Translated: useRecoilBridgeAcrossReactRoots.md is now translated into…
Apr 6, 2021
6871580
Translated: atomFamily.md is now translated into korean
Apr 6, 2021
dfd72ab
Merge pull request #1 from alstn2468/ko-translate
alstn2468 Apr 9, 2021
0a4d4b7
Add code.json korean translation
alstn2468 Apr 9, 2021
7b0b920
Add footer.json korean translation
alstn2468 Apr 14, 2021
66c4a73
Add navbar korean translation, fix core concepts title
alstn2468 Apr 14, 2021
f36d342
Add remaining Korean translation data
alstn2468 Apr 14, 2021
05f42e2
Update docs/i18n/ko/code.json
alstn2468 Apr 14, 2021
2a4765b
Fix typo (시그니쳐 -> 시그니처)
alstn2468 Apr 14, 2021
4e13657
Init index, resources page translation follow #377(ee54104)
alstn2468 Apr 15, 2021
ace9980
Merge branch 'docs' of https://github.com/alstn2468/Recoil into docs
alstn2468 Apr 15, 2021
2446615
index.js, resources 페이지 관련 번역 추가
alstn2468 Apr 15, 2021
4c68aa4
Merge branch 'docs' into docs
alstn2468 Apr 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/basic-tutorial/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ That helps with the re-renders of `<TodoItemCreator />` and `<TodoListFilters />

Thinking of a todo list as an array of objects is problematic because it forms a tight coupling between each individual todo item and the list of all todo items.

To fix this issue, we need to rethink our state shape by thinking about **normalized state**. In the context of our todo-list app, this means storing the **list** of item ids separately from the **data** for each invididual item.
To fix this issue, we need to rethink our state shape by thinking about **normalized state**. In the context of our todo-list app, this means storing the **list** of item ids separately from the **data** for each individual item.
alstn2468 marked this conversation as resolved.
Show resolved Hide resolved
alstn2468 marked this conversation as resolved.
Show resolved Hide resolved

> For a more detailed discussion on how to think about normalized state, see [this page from the Redux documentation](https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape).

Expand Down
27 changes: 27 additions & 0 deletions docs/docs_kr/api-reference/core/RecoilRoot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: <RecoilRoot ...props />
sidebar_label: <RecoilRoot />
---

값들을 갖는 원자 컨텍스트를 제공한다. Recoil의 hooks를 사용하는 모든 구성 요소의 조상이어야 한다. 여러개의 루트가 같이 존재할 수 있다. 원자는 각각의 루트 안에서 구별되는 값들을 가질 것 이다. 만약 그것들이 중첩되어 있다면, 가장 안쪽의 루트는 완벽하게 바깥쪽의 루트들을 가릴 것이다.

---

**속성**:

- `initializeState?`: `(MutableSnapshot => void)`
- [`MutableSnapshot`](/docs/api-reference/core/Snapshot#transforming-snapshots)을 사용하여 `<RecoilRoot>`의 원자 상태를 초기화하는 옵션 함수. 이것은 초기 렌더링에 대한 상태를 설정하며 이후 상태 변경이나 비동기적인 초기화를 위한 것이 아니다. 비동기 상태 변경에는 [`useSetRecoilState()`](/docs/api-reference/core/useSetRecoilState) 또는 [`useRecoilCallback()`](/docs/api-reference/core/useRecoilCallback)과 같은 Hooks를 사용하십시오.

### 예시

```jsx
import {RecoilRoot} from 'recoil';

function AppRoot() {
return (
<RecoilRoot>
<ComponentThatUsesRecoil />
</RecoilRoot>
);
}
```
105 changes: 105 additions & 0 deletions docs/docs_kr/api-reference/core/Snapshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: class Snapshot
sidebar_label: Snapshot
---

A `Snapshot` object represents an immutable snapshot of the state of Recoil [atoms](/docs/api-reference/core/atom). It is intended to standardize the API for observing, inspecting, and managing global Recoil state. It is mostly useful for dev tools, global state synchronization, history navigation, etc.

```jsx
class Snapshot {
// Accessors to inspect snapshot state
getLoadable: <T>(RecoilValue<T>) => Loadable<T>;
getPromise: <T>(RecoilValue<T>) => Promise<T>;

// API to transform snapshots for transactions
map: (MutableSnapshot => void) => Snapshot;
asyncMap: (MutableSnapshot => Promise<void>) => Promise<Snapshot>;

// Developer Tools API
getID: () => SnapshotID;
getNodes_UNSTABLE: ({
isModified?: boolean,
} | void) => Iterable<RecoilValue<mixed>>;
getInfo_UNSTABLE: <T>(RecoilValue<T>) => {...};
}

function snapshot_UNSTABLE(initializeState?: (MutableSnapshot => void)): Snapshot
```

## Obtaining Snapshots

### Hooks

Recoil provides the following hooks for obtaining snapshots based on the current state:

- [`useRecoilCallback()`](/docs/api-reference/core/useRecoilCallback) - Asynchronous access to a Snapshot
- [`useRecoilSnapshot()`](/docs/api-reference/core/useRecoilSnapshot) - Synchronous access to a Snapshot
- [`useRecoilTransactionObserver_UNSTABLE()`](/docs/api-reference/core/useRecoilTransactionObserver) - Subscribe to Snapshots for all state changes

### Building a Snapshot

You can also build a fresh snapshot using the `snapshot_UNSTABLE()` factory, which accepts an optional initializer function. This can be used for [testing](/docs/guides/testing) or evaluating selectors outside of a React context.

## Reading Snapshots

Snapshots are read-only with respect to atom state. They can be used to read atom state and evaluate selectors' derived state. `getLoadable()` provides a [`Loadable`](/docs/api-reference/core/Loadable) with the state of the atom or selector in this Snapshot. The `getPromise()` method can be used to wait for the evaluated value of asynchronous selectors, so you can see what the value would be based on the static atom state.

### Example

```jsx
function MyComponent() {
const logState = useRecoilCallback(({snapshot}) => () => {
console.log("State: ", snapshot.getLoadable(myAtom).contents);

const newSnapshot = snapshot.map(({set}) => set(myAtom, 42));
});
}
```

## Transforming Snapshots

There are cases where you may wish to mutate a snapshot. While snapshots are immutable, they have methods to map themselves with a set of transformations to a new immutable snapshot. The map methods take a callback that is passed a MutableSnapshot, which is mutated throughout the callback and will ultimately become the new snapshot returned by the mapping operation.

```jsx
class MutableSnapshot {
set: <T>(RecoilState<T>, T | DefaultValue | (T => T | DefaultValue)) => void;
reset: <T>(RecoilState<T>) => void;
}
```

Notice that `set()` and `reset()` have the same signature as callbacks provided to a writeable selector's `set` property, but they only effect the new snapshot, not the current state.

## Going to a Snapshot

The following hook can be used for navigating the current Recoil state to the provided `Snapshot`:
- [`useGotoRecoilSnapshot()`](/docs/api-reference/core/useGotoRecoilSnapshot) - Update current state to match a Snapshot


## Developer Tools

Snapshots provide some methods useful for building developer tools or debugging capabilities with Recoil. This API is still evolving, and thus marked as `_UNSTABLE`, as we work on the initial dev tools.

### Snapshot IDs

Each committed state or mutated Snapshot has a unique opaque version ID that can be obtained via `getID()`. This can be used to detect when we have gone back to a previous snapshot via `useGotoRecoilSnapshot()`.

### Enumerate Atoms and Selectors

The `getNodes_UNSTABLE()` method can be used to iterate all atoms and selectors that were in use for this snapshot. Atoms, selectors, and families may be created at any time. However, they will only show up in the snapshot if they are actually used. Atoms and selectors may be removed from subsequent state snapshots if they are no longer being used.

An optional `isModified` flag may be specified to only return atoms which have been modified since the last transaction.

### Debug information

The `getInfo_UNSTABLE()` method provides additional debug information for atoms and selectors. The debug information provided is evolving, but may include:

* `loadable` - A Loadable with the current state. Unlike methods like `getLoadable()`, this method will not mutate the snapshot at all. It provides the current state and will not initialize new atoms/selectors, perform any new selector evaluations, or update any dependencies or subscriptions.
* `isSet` - True if this is an atom with an explicit value stored in the snapshot state. False if this is a selector or using the default atom state.
* `isModified` - True if this is an atom which was modified since the last transaction.
* `type` - Either an `atom` or `selector`
* `deps` - An iterator over the atoms or selectors this node depends on.
* `subscribers` - Information about what is subscribing to this node for this snapshot. Details under development.

## State Initialization

The [`<RecoilRoot>`](/docs/api-reference/core/RecoilRoot) component and `snapshot_UNSTABLE()` factory take an optional `initializeState` prop for initializing the state via a `MutableSnapshot`. This can be helpful for loading persisted state when you know all atoms in advance and is compatible with server-side rendering where the state should be setup synchronously with the initial render. For per-atom initialization/persistence and ease of working with dynamic atoms, consider [atom effects](/docs/guides/atom-effects)
63 changes: 63 additions & 0 deletions docs/docs_kr/api-reference/core/atom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: atom(options)
sidebar_label: atom()
---

*atom*은 Recoil의 상태를 표현한다. `atom()` 함수는 쓰기 가능한 `RecoilState` 객체를 반환한다.

---

```jsx
function atom<T>({
key: string,
default: T | Promise<T> | RecoilValue<T>,

effects_UNSTABLE?: $ReadOnlyArray<AtomEffect<T>>,

dangerouslyAllowMutability?: boolean,
}): RecoilState<T>
```

- `key` - 내부적으로 atom을 식별하는데 사용되는 고유한 문자열. 이 문자열은 어플리케이션 전체에서 다른 atom과 selector에 대해 고유해야 한다.
- `default` - atom의 초깃값 또는 `Promise` 또는 동일한 타입의 값을 나타내는 다른 atom이나 selector.
- `effects_UNSTABLE` - atom을 위한 선택적인 [Atom Effects](/docs/guides/atom-effects) 배열.
- `dangerouslyAllowMutability` - Recoil은 atom을 이용해 다시 렌더링 되는 컴포넌트에 언제 알려야 할지 알기 위해 atom의 상태 변화에 의존한다. 만약 atom의 값이 변경될 경우, 이를 거치지 않고 등록된 컴포넌트에 제대로 알리지 않고 상태가 변경될 수 있다. 이를 방지하기 위해 저장된 모든 값이 변경되지 않는다. 경우에 따라 이 옵션을 사용하여 이 옵션을 재정의할 수 있다.

---

atom과 상호작용하기 위해 가장 자주 사용되는 Hooks:

- [`useRecoilState()`](/docs/api-reference/core/useRecoilState): atom을 읽고 쓰려고 할 때 이 Hook을 사용한다. 이 Hook는 atom에 컴포넌트을 등록하도록 한다.
- [`useRecoilValue()`](/docs/api-reference/core/useRecoilValue): atom을 읽기만 할 때 이 Hook를 사용한다. 이 Hook는 atom에 컴포넌트를 등록하도록 한다.
- [`useSetRecoilState()`](/docs/api-reference/core/useSetRecoilState): atom에 쓰려고만 할 때 이 Hook를 사용한다.
- [`useResetRecoilState()`](/docs/api-reference/core/useResetRecoilState): atom을 초깃값으로 초기화할 때 이 Hook을 사용한다.

컴포넌트가 등록되지 않고 atom의 값을 읽어야 하는 드문 경우는 [`useRecoilCallback()`](/docs/api-reference/core/useRecoilCallback)를 참조하면 된다.

정적인 값으로 atom을 초기화하거나 같은 유형의 값을 나타내는 `Promise` 또는 `RecoilValue`을 사용하여 원자를 초기화할 수 있다. 왜냐하면 `Promise`가 보류 중이거나 기본 selector가 비동기일 수 있기 때문에 atom의 값도 보류 중이거나 읽을 때 오류를 발생시킬 수 있다는 것을 의미한다. 현재 atom을 설정할 때 `Promise`을 지정할 수 없다는 점에 유의해야 한다. 비동기 함수를 사용하기 위해서는 [selectors](/docs/api-reference/core/selector)를 사용한다.

atom은 `Promise`나 `RecoilValues`를 직접 저장하는 데 사용할 수 없지만 객체를 감쌀 수도 있다. `Promises`은 변경될 수 있다는 점에 유의해야 한다. Atom은 `function`로 설정할 수 있지만, 함수가 순수하다면, 그러기 위해서는 setter형태의 updater를 사용해야 할 수도 있다. (예: `set(myAtom, () => myFunc);`).

### 예시

```jsx
import {atom, useRecoilState} from 'recoil';

const counter = atom({
key: 'myCounter',
default: 0,
});

function Counter() {
const [count, setCount] = useRecoilState(counter);
const incrementByOne = () => setCount(count + 1);

return (
<div>
Count: {count}
<br />
<button onClick={incrementByOne}>Increment</button>
</div>
);
}
```
34 changes: 34 additions & 0 deletions docs/docs_kr/api-reference/core/isRecoilValue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: isRecoilValue(value)
sidebar_label: isRecoilValue()
---

`value`이 atom이나 selector일 경우 `true`를 반환하고 그렇지 않을 경우 `false`를 반환한다.

```jsx
function isRecoilValue(value: mixed): boolean
```

---

### Example

```jsx
import {atom, isRecoilValue} from 'recoil';

const counter = atom({
key: 'myCounter',
default: 0,
});

const strCounter = selector({
key: 'myCounterStr',
get: ({get}) => String(get(counter)),
});

isRecoilValue(counter); // true
isRecoilValue(strCounter); // true

isRecoilValue(5); // false
isRecoilValue({}); // false
```
Loading