Jordan Belford from The Wolf of Wall Street movie. He goes to Switzerland and visits a bank to secure his money. He has written down a list of instructions in a piece of paper. He then creates an account associated with this instructions. The bank has to strictly follow that instructions with regards to his account. Recently in India a guy swindled $2 Billion, so staring Nirav Modi as Jordan Belford as an example let's learn reduxjs.

Reduxjs ft Nirav Modi

<script src=""></script>
const niravModiInstructions = (balance = {amount: 11000, name: "Nirav Modi"}, action) => {
    switch (action.type) {
        case "ABORT":
         return {amount: 0, name: "Nirav Modi"}
            return balance;
const swissBankAccount = Redux.createStore(niravModiInstructions)        

console.log('balance', swissBankAccount.getState() )
swissBankAccount.dispatch({type: "ABORT"})
console.log('balance', swissBankAccount.getState() )

  <div id="app">

Copy, paste the above code in a new index.html file and open your browser console and play with it

So far good, next