Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is MeteorListView's reactive? #41

Closed
rafaelcorreiapoli opened this issue Mar 25, 2016 · 3 comments
Closed

is MeteorListView's reactive? #41

rafaelcorreiapoli opened this issue Mar 25, 2016 · 3 comments

Comments

@rafaelcorreiapoli
Copy link

Hi. I'm trying to do a simple app just for testing purposes

I have a publication on my meteor server:

Meteor.publish('pokemons', function(type) {
  let query = type ? {
    type: type
  } : {};

  return Pokemons.find(query);
});

On my RN app:

let types = [
  'fire',
  'water',
  'grass'
]
  constructor(props) {
    super(props);
    this.state = {
      currentType: 0
    }
  }
  startMeteorSubscriptions() {
    Meteor.subscribe('pokemons', types[this.state.currentType]);
  }
  _handlePress() {
    let currentType = this.state.currentType;
    currentType++;
    currentType = currentType % types.length;

    this.setState({
      currentType
    })
  }

The subscription is changing correctly when the state is changed... but:

        <MeteorListView
          collection="pokemons"
          selector={{type: types[this.state.currentType]}}
          renderRow={this.renderItem}
        />

The selector on MeteorListView does not respond to changes on the state... it keeps filtering by the first selector passed to it (types[0] -> 'fire')

@Mokto
Copy link
Contributor

Mokto commented Mar 25, 2016

Oh you are absolutely right !

Thank you for warning me.

Fixing it soon ;)

@Mokto
Copy link
Contributor

Mokto commented Mar 25, 2016

Done ! Available in 1.0.0-beta21

@Mokto Mokto closed this as completed Mar 25, 2016
@rafaelcorreiapoli
Copy link
Author

Thank you! Glad to know that I contributed to this awesome project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants