Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mehdux

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mehdux - npm Package Compare versions

Comparing version 0.2.14 to 0.2.15

2

package.json

@@ -7,3 +7,3 @@ {

"license": "MIT",
"version": "0.2.14",
"version": "0.2.15",
"source": "src/main.js",

@@ -10,0 +10,0 @@ "main": "dist/mehdux.js",

@@ -69,10 +69,25 @@ <div align="center">

### Subscribe to state changes
```Javascript
store.connect(console.log)
store.connect()(console.log)
store.actions.setValue('A cooler value')
// logs { someValue: 'A cooler Value' }
```
To subscribe to changes in certain parts of the state tree you can pass a function as the first argument to the `connect`-function. This is similiar to how you map state to props in `react-redux`.
```Javascript
const mapState = state => ({
interesting: state.something
})
store.connect(mapState)(console.log)
store.actions.setSomething('This is interesting')
// logs { interesting: 'This is interesting' }
```
### Usage with other frameworks

@@ -79,0 +94,0 @@ `Mehdux` has built-in integrations with `react` and `preact`.

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