Replacing DataStore with RemoteDataStore

Your RemoteDataStore module is complete. It is time to replace your DataStore instance with a RemoteDataStore instance.

Open main.js. Begin by importing RemoteDataStore from the App namespace.

(function (window) {
  'use strict';
  var FORM_SELECTOR = '[data-coffee-order="form"]';
  var CHECKLIST_SELECTOR = '[data-coffee-order="checklist"]';
  var App = window.App;
  var Truck = App.Truck;
  var DataStore = App.DataStore;
  var RemoteDataStore = App.RemoteDataStore;
  var FormHandler = App.FormHandler;
...

Also, add a new variable called SERVER_URL and assign it a string with the URL of the CoffeeRun test server.

(function (window) { 'use strict'; var FORM_SELECTOR = '[data-coffee-order="form"]'; var ...

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.