Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajikaimal/aint
:tada: Simpler and minimal state management
https://github.com/rajikaimal/aint
Last synced: 10 days ago
JSON representation
:tada: Simpler and minimal state management
- Host: GitHub
- URL: https://github.com/rajikaimal/aint
- Owner: rajikaimal
- License: mit
- Created: 2017-07-19T15:30:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-10T11:28:25.000Z (over 6 years ago)
- Last Synced: 2024-10-05T17:41:12.794Z (about 1 month ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aint
Simpler and minimal state management
ain't nobody got time for complex state
### Usage
```js
const aint = require("aint");
const loggerMiddlware = aint.loggerMiddlware();
aint.use(loggerMiddlware);aint.publish("user", { firstname: "Rajika", lastname: "Imal" })
.then(state => {
console.log(state);
})
.catch(err => {
console.log(err);
});aint.publish("user.status", { private: false })
.then(state => {
console.log(state);
})
.catch(err => {
console.log(err);
});aint.subscribe("user")
.then(state => {
console.log(state);
})
.catch(err => {
console.log(err);
});aint.get();
aint.get("user");
aint.get("user.firstname");
``````js
{
user: {
firstname: "Rajika",
lastname: "Imal"
}
blog: {
url: "rajikimal.github.io"
}
}
```### API