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, | |
| }, | |
| 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
| 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 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
| 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 = () => { | |
| 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 api = async (endpoint) => { | |
| const url = new URL( | |
| endpoint, | |
| 'https://jsonplaceholder.typicode.com', | |
| ).toString(); | |
| const response = await fetch(url); | |
| if (response.status === 200) { | |
| return response.json(); | |
| } |
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 pattern = new RegExp("https://store.steampowered.com/account/history"); | |
| if (!pattern.test(window.location.href)) { | |
| return; | |
| } | |
| let last; | |
| const content = (item) => | |
| (item.querySelector("div") ?? item).innerText.replace(/\s+/g, " ").trim(); |
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
| setTimeout(() => { | |
| const domain = 'https://www.brawlhalla.com/rankings'; | |
| if (!window.location.href.startsWith(domain)) { | |
| return; | |
| } | |
| const input = document.querySelector("input[name=p]"); | |
| if (input) { |