uStore library - XMPieLab/uStore-NG GitHub Wiki
uStore library is a new JavaScript library which is part of uStore’s NG technology. It contains out-of-the-box services provided by XMPie which enhance your theme development process.
The uStore library provides the following services:
- Call API requests to the uStore server. See Working with REST API
- Use uStore data objects through the state object. See uStore data model
- Set and Get custom data throughout the application. See Managing custom state
Import the (@ustore/core) library and the UStoreProvider object as follows:
import {UStoreProvider} from '@ustore/core'
Usage example
The following is an example of accessing the REST API and getting a category model from the server:
UStoreProvider.api.categories.getCategory(categoryID)
Full usage of this library is explained in each of the above listed services.