Comparing version 2.0.0 to 4.0.0
{ | ||
"name": "agestor", | ||
"version": "2.0.0", | ||
"version": "4.0.0", | ||
"main": "src/index.tsx", | ||
@@ -5,0 +5,0 @@ "author": "Henrique Borges <henriqueborgeshbr@gmail.com>", |
# agestor | ||
> A dead simple 3kb store for React | ||
> A dead simple 1.3kb store for React | ||
@@ -22,3 +22,3 @@ # Install | ||
import React from 'react' | ||
import { createStore } from 'agestor' | ||
import createStore from 'agestor/createStore' | ||
@@ -44,3 +44,3 @@ const initialValue = { | ||
import React from 'react' | ||
import { withStore } from 'agestor' | ||
import withStore from 'agestor/withStore' | ||
@@ -101,9 +101,4 @@ const MyComponent = ({ store }) => ( | ||
When creating the store with `createStore` you can pass some options: | ||
When creating the store with `createStore` you can pass the store initial value: | ||
- Initial store value | ||
- A listener callback function | ||
## Initial value | ||
```jsx | ||
@@ -118,12 +113,2 @@ const initialValue = { | ||
export default createStore(App, initialValue) | ||
``` | ||
## Listener callback | ||
A callback function that is called after the methods: `set`, `setAll`, `remove`. The function accepts the new store value as parameter | ||
```jsx | ||
export default createStore(App, {}, () => { | ||
console.log('The store changed!') | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3946
34
110