GithubHelp home page GithubHelp logo

mweststrate / mst-course Goto Github PK

View Code? Open in Web Editor NEW
65.0 4.0 25.0 305 KB

Lesson sources for "Manage Application State with Mobx-state-tree" course

Home Page: https://egghead.io/courses/manage-application-state-with-mobx-state-tree

HTML 7.40% CSS 8.06% JavaScript 84.54%

mst-course's Introduction

mst-course's People

Contributors

mweststrate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mst-course's Issues

TypeError: group.users.values(...).map is not a function

I am getting this error in the App.js file
Following is the code

render() {
    const { group } = this.props;
    const selectedUser = group.users.get(this.state.selectedUser);
    return (
      <div className="App">
        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h1 className="App-title">WishList</h1>
        </header>
        <select onChange={this.onSelectUser}>
          <option>- Select user -</option>
          {group.users.values().map(user => (
            <option key={user.id} value={user.id}>
              {user.name}
            </option>
          ))}
        </select>
        {selectedUser && <WishListView wishList={selectedUser.wishList} />}
      </div>
    );
  }

This is how my index.js file looks

let initialState = {
  users: {
    'a342': {
      id: 'a342',
      name: 'Homer',
      gender: 'm',
    },
    '5fc2': {
      id: '5fc2',
      name: 'Marge',
      gender: 'f',
    },
    '663b': {
      id: '663b',
      name: 'Bart',
      gender: 'm',
    },
    '65aa': {
      id: '65aa',
      name: 'Maggie',
      gender: 'f',
    },
    'ba32': {
      id: 'ba32',
      name: 'Lisa',
      gender: 'f',
    },
  },
};

let group = Group.create(initialState);

function renderApp() {
  ReactDOM.render(<App group={group} />, document.getElementById('root'));
}

@mweststrate can u help me with this ?

ERR_CONNECTION_REFUSED

I am working on this course and if I install and run the repo as-is, for some reason it can't load the db.json on port 3001. I get this error:

GET http://localhost:3001/users net::ERR_CONNECTION_REFUSED........Group.js:37

I'm running it on Ubuntu and have tried multiple node versions.

Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.