1.0.2 • Published 7 years ago

@fvlab/configuration-store-service v1.0.2

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

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 => ...);