Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- xcode
- 예제 실행 시 에러 관련_
- pkg-config
- Info.plist
- OpenCV-4.1.0
- mac os
- NSCameraUsageDescription
- OpenCV로 배우는 영상처리 및 응용
- WebAssembly in Action
- 웹어셈블리 인 액션
- homebrew
- AutoEncoder
- stackoverflow
- 영상처리
- VAE
- VisualCapture
- Camera Usage Description
- OpenCV
Archives
- Today
- Total
DEV.log
custom-stores 본문
<!-- App.svelte -->
<script>
import { count } from './stores.js';
</script>
<h1>The count is {$count}</h1>
<button on:click={count.increment}>+</button>
<button on:click={count.decrement}>-</button>
<button on:click={count.reset}>reset</button>
// stores.js
import { writable } from 'svelte/store';
function createCount() {
const { subscribe, set, update } = writable(0);
return {
subscribe,
increment: () => update(n => n + 1),
decrement: () => update(n => n - 1),
reset: () => set(0)
};
}
export const count = createCount();
https://svelte.dev/tutorial/custom-stores
Stores / Custom stores • Svelte Tutorial
Stores / Custom stores a. Basicsb. Adding datac. Dynamic attributesd. Stylinge. Nested componentsf. HTML tagsg. Making an appa. Assignmentsb. Declarationsc. Statementsd. Updating arrays and objectsa. Declaring propsb. Default valuesc. Spread propsa. If blo
svelte.dev
'Svelte > tutorial' 카테고리의 다른 글
slots (0) | 2022.02.01 |
---|---|
classes (0) | 2022.02.01 |
derived-stores (0) | 2022.02.01 |
readable-stores (0) | 2022.02.01 |
auto-subscriptions (0) | 2022.02.01 |
Comments