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
const HelloWorld = () => { | |
const [show, setShow] = useState(false); | |
return ( | |
<section> | |
<h1>Merhaba dünya!</h1> | |
<GoodMorning show={show} /> | |
<button onClick={() => setShow(!show)}>Merhaba!</button> | |
</section> | |
); |
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
const HelloWorld = () => { | |
const [show, setShow] = useState(false); | |
return ( | |
<section> | |
<h1>Merhaba dünya!</h1> | |
{show ? <p>Günaydın.</p> : null} | |
<button onClick={() => setShow(!show)}>Merhaba!</button> | |
</section> | |
); |
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
const HelloWorld = () => ( | |
<section> | |
<h1>Merhaba dünya!</h1> | |
</section> | |
); | |
ReactDOM.render( | |
HelloWorld, | |
document.getElementById('root'), | |
); |
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
Vuex.component('app-login', { | |
template: ` | |
<section> | |
<header> | |
<h1>Giriş yap</h1> | |
</header> | |
<main v-if="user"> | |
<p>{{ user.username }} olarak giriş yapıldı</p> | |
</main> |
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
const store = Vuex.Store({ | |
state: { | |
user: null, | |
}, | |
mutations: { | |
setUser(state, user) { | |
state.user = user; | |
}, | |
}, | |
actions: { |
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
const store = Vuex.Store({ | |
state: { | |
user: null, | |
}, | |
mutations: { | |
setUser(state, user) { | |
state.user = user; | |
}, | |
}, | |
}); |
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
const store = Vuex.Store({ | |
state: { | |
user: null, | |
}, | |
}); |
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
const user = new ReplaySubject(1); | |
authorize(session => user.next(session.user)); |
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
const fibonacci = new BehaviorSubject(1); | |
fibonacci.next(1); | |
fibonacci.next(2); | |
fibonacci.next(3); | |
fibonacci.next(5); | |
fibonacci.next(8); | |
console.log(fibonacci.value); |