@fvlab/configuration-store-service
v1.0.2
Published
SDK to access a GraphQL-api implementation of the configuration store
Downloads
1
Readme
configuration-store-service
An SDK for access a particular type of configuration-store api/service that has been implemented in GraphQL.
Usage
Create and initialize the object.
const currentUserId = '1234';
const settings = new ConfigurationStoreService('url of remote configuration store graphql service', currentUserId);
return settings.init().then(() => {...});
Retrieve values by key or get it's default value if a value doesn't exist for the key.
return settings.getGlobalData('someKey', 'default value')
.then(globalValue => ...);
return settings.getUserData('someOtherKey', 'default value')
.then(userValue => ...);
Set the key-value pair.
return settings.setGlobalData('someKey', 'some value')
.then(globalValue => ...);
return settings.setUserData('someOtherKey', 'some value')
.then(userValue => ...);