-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
353 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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,19 @@ | ||
# \$\$append | ||
|
||
- [source](./append.index.js) | ||
- [test](./append.spec.js) | ||
|
||
첫 번째로 받은 엘리먼트를 두 번째로 받은 엘리먼트의 자식 엘리먼트로 추가합니다. | ||
`appendChild` 와 동일한 함수입니다. | ||
|
||
```javascript | ||
const parent_el = $$el(`<g></g>`)(); | ||
const child_el = $$el(`<circle cx="0" cy="0" r="10"></circle>`)(); | ||
|
||
$$append(child_el)(parent_el); | ||
|
||
console.log(parent_el); | ||
// <g> | ||
// <circle cx="0" cy="0" r="10"></circle> | ||
// </g> | ||
``` |
This file contains 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 @@ | ||
export const $$append = (child) => (parent) => parent.appendChild(child); |
This file contains 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,19 @@ | ||
import { expect } from "chai"; | ||
import { $$el } from "../el/el.index.js"; | ||
import { $$append } from "./append.index.js"; | ||
|
||
export default ({ describe, it }) => [ | ||
describe(`$$append`, function () { | ||
it(`The function append the element to the parent element as a child element.`, function () { | ||
// given | ||
const parent_el = $$el(`<g></g>`)(); | ||
const child_el = $$el(`<circle cx="0" cy="0" r="10"></circle>`)(); | ||
|
||
// when | ||
$$append(child_el)(parent_el); | ||
|
||
// then | ||
expect(parent_el.contains(child_el)).true; | ||
}); | ||
}), | ||
]; |
This file contains 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,19 @@ | ||
# \$\$appendTo | ||
|
||
- [source](./appendTo.index.js) | ||
- [test](./appendTo.spec.js) | ||
|
||
첫 번째로 받은 엘리먼트에 두 번째로 받은 엘리먼트를 자식 엘리먼트로 추가합니다. | ||
`appendChild` 와 동일한 함수입니다. | ||
|
||
```javascript | ||
const parent_el = $$el(`<g></g>`)(); | ||
const child_el = $$el(`<circle cx="0" cy="0" r="10"></circle>`)(); | ||
|
||
$$appendTo(parent_el)(child_el); | ||
|
||
console.log(parent_el); | ||
// <g> | ||
// <circle cx="0" cy="0" r="10"></circle> | ||
// </g> | ||
``` |
This file contains 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,3 @@ | ||
export const $$appendTo = (parent) => (child) => ( | ||
parent.appendChild(child), parent | ||
); |
This file contains 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,19 @@ | ||
import { expect } from "chai"; | ||
import { $$el } from "../el/el.index.js"; | ||
import { $$appendTo } from "./appendTo.index.js"; | ||
|
||
export default ({ describe, it }) => [ | ||
describe(`$$appendTo`, function () { | ||
it(`The function append the element to the parent element as a child element.`, function () { | ||
// given | ||
const parent_el = $$el(`<g></g>`)(); | ||
const child_el = $$el(`<circle cx="0" cy="0" r="10"></circle>`)(); | ||
|
||
// when | ||
$$appendTo(parent_el)(child_el); | ||
|
||
// then | ||
expect(parent_el.contains(child_el)).true; | ||
}); | ||
}), | ||
]; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.