Socket
Socket
Sign inDemoInstall

agestor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agestor - npm Package Compare versions

Comparing version 2.0.0 to 4.0.0

createStore.tsx

2

package.json
{
"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!')
})
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc