# Install
# Install in Project
To use Auora in a project, add the package to your package dependencies via:
npm install --save auora
Or, with yarn:
yarn add auora
# Use via CDN
To use this package via CDN, import it in your project via:
<script src="https://unpkg.com/auora/dist/index.min.js"></script>
# Configuration
Once you've added the package to your project, you can import the Store
object and use it like so:
import { Store } from 'auora';
const store = new Store({
// state
state: {
count: 0,
},
// actions
actions: {
increment({ state }) {
state.count += 1;
return state.count;
},
},
});
See the Guide section of the documentation for more information on how to fully utilize all of the features Auora provides.
# Options
There are several configuration options you can change when using Auora. The list below will likely grow throughout the lifecycle of this project:
Option | Description | Default |
---|---|---|
recurse | Recursively commit data during state transactions. This will slow down applications storing a lot of state data but will enable an easier API for updating deeply nested data. | false |
Here is how you can set specific options when creating Store objects from Auora:
const store = new Store({
state: { ... },
options: {
recurse: false,
}
});
TIP
The code above shows all of option defaults.