2021-11-22 00:31:42 +07:00
|
|
|
import { atom } from 'nanostores';
|
2021-06-24 19:39:17 -03:00
|
|
|
|
2021-11-22 00:31:42 +07:00
|
|
|
const counter = atom(0);
|
2021-06-24 19:39:17 -03:00
|
|
|
|
|
|
|
function increaseCounter() {
|
2021-11-22 00:31:42 +07:00
|
|
|
counter.set(counter.get() + 1);
|
2021-06-24 19:39:17 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
function decreaseCounter() {
|
2021-11-22 00:31:42 +07:00
|
|
|
counter.set(counter.get() - 1);
|
2021-06-24 19:39:17 -03:00
|
|
|
}
|
|
|
|
|
2021-06-24 22:40:29 +00:00
|
|
|
export { counter, increaseCounter, decreaseCounter };
|