본문으로 건너뛰기

NumberTypedStorage

TypedStorage를 확장하여, number 타입에 specific한 유틸 메소드들을 제공합니다.

Note

NumberTypedStorage는 subpath export된 module 입니다. 꼭 @toss/storage/typed를 사용해주세요.

Example

import { NumberTypedStorage } from '@toss/storage/typed';

const count = new NumberTypedStorage('count', { initialValue: 0 });
count.increase(); // 1
count.decrease(); // 0
count.increase(10); // 10
count.decrease(5); // 5