New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jeux

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jeux - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

4

package.json
{
"name": "jeux",
"version": "0.5.0",
"description": "App Container",
"version": "0.6.0",
"description": "Javascript state container",
"main": "lib/jeux.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -6,7 +6,50 @@ # API

# 2nd-level API
* dispatch()
* dispatch(action)
* subscribe(callback(newState))
* getState()
## Store
The store is nothing but a js object that holds your application state
## Reducers
Reducers are functions that accept the current slice of the state that the reducer responds to and the current action being dispatched.
## Middleware
Middleware are functions that are called before an action gets to any reducers.
Normal flow --- dispatch action --- reducers --- updated state
Flow with middleware --- dispatch action --- passes action through middlewares --- reducers --- updated state
## createStore
CreateStore accepts the reducer object as a first arg. This is a mapping of keys to functions.
See Examples below for more details.
## dispatch
This method is used to dispatch actions to the store and the store takes the actions runs it through the reducers and updates
the state accordingly.
most actions look like this
```javascript
{
type : "FETCH_USER",
extraField : "someData"
}
```
## subscribe
This method is to be used if you would like to know when changes to the store have occurred. Ths method accepts
a callback function that is invoked when the store changes.
## getState
The methods returns the current state of your application
## Examples

@@ -13,0 +56,0 @@

@@ -1,3 +0,3 @@

const chainer = (starter, mw) => {
const args = [starter, ...mw];
const chainer = (starter, middleware) => {
const args = [starter, ...middleware];
const functions = [];

@@ -4,0 +4,0 @@

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