ManuelDeLeon / viewmodel-react

Create your React components with view models.
MIT License
24 stars 3 forks source link

prop.depend() not working? #10

Closed fvpDev closed 8 years ago

ManuelDeLeon commented 8 years ago

What do you mean? It's there...

Example({
  name: '',
  autorun() {
    console.log( this.name() );
  },
  render() {
    <div />
  }
})
fvpDev commented 8 years ago

in docs I guess

ManuelDeLeon commented 8 years ago

Ah, I'll add it to my todo list.

fvpDev commented 8 years ago

The reason I'm asking is actually because I have this script that hides <br class="mobile" /> for desktop version of my projects on route change with an autorun, but I was trying to see if there's a way to have it done after info has been replaced in a React class. prop.depend() keeps giving me a depend is not a function error or just calling the prop like so autorun() { this.infos(); this.brDisplay() }, doesn't work, so I have to do this: autorun() { console.log(!!this.infos()); this.brDisplay() },

ManuelDeLeon commented 8 years ago

I was trying to see if there's a way to have it done after info has been replaced in a React class

Please make a repro. I'm fixing something that smells similar to that but with Signals.

ManuelDeLeon commented 8 years ago

I updated the documentation. Create a new issue if you can get a repro working.