aboutsummaryrefslogtreecommitdiff
path: root/src/notes/state.notes.svelte
blob: bde0f65f1de2779ed6bfa3c84dc6ffc9db0a21c5 (plain)
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
32
33
34
35
36
37
38
<script lang="ts">
	import { Notes } from '@components'
</script>
<Notes>
    <ul>
        <li>
            useState hooks allows to have state variable inside a FUNCTIONAL COMPONENT
        </li>
        <li>
            useState ENCAPSULATES only a single value
        </li>
        <li>
            For mulatiple values you may need to call multiple useState's
        </li>
        <li>
            useState arguments
            <ul>
                <li>
                    Initialization of a state variable
                </li>
                <li>
                    Passing function as initial value - to calculate an initial value
                </li>
            </ul>
        </li>
        <li>
            Managing multiple states
            <ul>
                <li>
                    Multi-variable's
                </li>
                <li>
                    Object as value
                </li>
            </ul>
        </li>
    </ul>
</Notes>