Closed Meta-Maxim closed 3 years ago
My personal opinion is that DataStore scopes should be instead turned into prefixes / suffixes in store names and that an additional scope variable is redundant. Do you have any additional thoughts / info on the reason of this PR?
My personal opinion is that DataStore scopes should be instead turned into prefixes / suffixes in store names and that an additional scope variable is redundant. Do you have any additional thoughts / info on the reason of this PR?
Why do you think scopes are better as string prefixes when a specific argument exists? I think they're less clean:
You're concatenating strings for no reason and you're introducing a implicit mapping process / id system: [scope, dataStoreName] -> scopeAndNameID
to then use as the datastore index when the Roblox API already provides clean scoping API.
I use scope with all systems under one scope, and I reset the whole game data when testing before release for example, or have studio-only data. The tradeoff seems to be concatenation vs. passing an argument, and I feel that an argument is cleaner code as the two strings passed are then logical units (as they are in my use case two different global variables): dataStoreName and gameScope (studio, live-game, pre-release).
The scope is also not guaranteed to be redundant as Roblox-side datastores might use the scope internally quicker / not connect to data outside of scope for performance benefits???
Thank you for your contribution! Your proposed feature has been added.
You can find documentation for it here: https://madstudioroblox.github.io/ProfileService/api/#profileservicegetprofilestore
Added an optional scope parameter to GetProfileStore()