1.0.3 • Published 8 months ago
@rbxts/tally-store v1.0.3
Tally Store
This library provides an efficient way to create global counters that are automatically updated across all services.
For example, it could be used to show the number of a type of pet or car collected.
It makes use of Skilift under the hood, which is a datastore library without session locking.
Quick Start
type Pet = "dog" | "cat" | "rat";
type PetTally = { [P in Pet]?: number };
// create a tally store
const pets = new TallyStore<PetTally>(
"PetTally",
(data) => {
// do something with the data, like showing in a pet index
},
{
defaultData: {},
},
);
// increment the amount of dogs collected by 1
pets.increment("dog", 1);📦 Installation
npm install @rbxts/tally-store🪪 License
Tally Store is available under the MIT license. See the LICENSE.md file for more info.