The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Connecting to a Reflux Store in React

Connecting to a Reflux Store in React

3:37
Reflux makes connecting to a store extremely simple. Let's refactor a React component so that the data now comes from a Reflux store and allows the data store to trigger future updates.
Watch this lesson now
Avatar
egghead.io

Reflux makes connecting to a store extremely simple. Let's refactor a React component so that the data now comes from a Reflux store and allows the data store to trigger future updates.

Avatar
Gustavo Saiani

Superagent was at version 1.1.0 when I installed it.

For the request to work, I replaced

init() {
    request("https://jsbin.com/dekafa.json", res => {
      this.data.people = JSON.parse(res.text);
      this.trigger(this.data);
    })
  },

with

init() {
    var that = this

    request
      .get("https://jsbin.com/dekafa.json")
      .end(function(err, res) {
        that.data.people = JSON.parse(res.text)
        that.trigger(that.data)
      })
  },
In reply to egghead.io
Avatar
Nicolas

I'm so impressed with how this guy teaches!

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?