Buckets:
| import React from 'react' | |
| import { makeAutoObservable } from 'mobx' | |
| import { observer } from 'mobx-react' | |
| class Counter { | |
| count = 0 | |
| constructor() { | |
| makeAutoObservable(this) | |
| } | |
| increase() { | |
| this.count += 1 | |
| } | |
| } | |
| const myCounter = new Counter() | |
| @observer | |
| class CounterView extends React.Component { | |
| render() { | |
| return ( | |
| <> | |
| <span id="count">Current number: {this.props.counter.count}</span> | |
| <button id="increase" onClick={() => this.props.counter.increase()}> | |
| Increase | |
| </button> | |
| </> | |
| ) | |
| } | |
| } | |
| export default function Home() { | |
| return <CounterView counter={myCounter} /> | |
| } | |
Xet Storage Details
- Size:
- 644 Bytes
- Xet hash:
- 5aa5656aef412df362339e406ca96e15b5525e98cc453a326613a9db4bd5bd81
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.