Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <script src="https://npmcdn.com/redux@^3.5.2/dist/redux.min.js"></script>
  <script src="https://npmcdn.com/@reactivex/rxjs/dist/global/Rx.umd.js"></script>
  <script src="https://npmcdn.com/redux-observable/dist/redux-observable.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
  <script>
    const { createStore, applyMiddleware } = Redux;
    const { createEpicMiddleware } = ReduxObservable;
    const epicMiddleware = createEpicMiddleware(pingEpic);
    const store = createStore(pingReducer,
      applyMiddleware(epicMiddleware)
    );
    /**
     * This is using raw HTML + redux.
     * 
     * You will most likely use some sort of UI framework
     * like React, Angular, etc
     */
    const renderApp = () => {
      const { isPinging } = store.getState();
      document.body.innerHTML = `
        <div>
          <h1>is pinging: ${isPinging}</h1>
          <button
            onclick="(${() => {
              store.dispatch(ping());
            }})();"
          >
            Start PING
          </button>
        </div>
      `;
    };
    store.subscribe(renderApp);
    renderApp();
  </script>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jayphelpspro
0viewers