Socket
Socket
Sign inDemoInstall

jeux-thunk

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jeux-thunk

thunk middleware for jeux


Version published
Maintainers
1
Install size
26.9 kB
Created

Readme

Source

What is this??!!

Instead of just dispatching plain js objects, Jeux-Thunk allows you to dispatch functions which are invoked with

your Jeux store's dispatch, getState method. Because you are dispatching a function, things can be

done asynchronously now.

Example


const store = Jeux.createStore(....);

function AsyncCall(){
    return function(dispatch, getState){
        dispatch({type : "REQUEST_DATA"})
        fetch('http://example.com/movies.json')
          .then(function(response) {
          return response.json();
        })
        .then(function(myJson) {
          dispatch({type: "RECEIVE_DATA", movies:myJson})
        });
    }
}

FAQs

Last updated on 14 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc