Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Parameters in fragments never get updated. #64

Open
ghost opened this issue Mar 8, 2016 · 0 comments
Open

Parameters in fragments never get updated. #64

ghost opened this issue Mar 8, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 8, 2016

They always seem to be stuck on their initialVariables values (a problem we didn't have in the previous major version of Transmit). And I'm a little at a loss at to how to update them, as the docs' example code appears to be out of date?

  • export default Transmit.createContainer(Newsfeed, {
    /**
    * Default query params.
    */
    queryParams: {
    currentNewsfeed: [],
    nextStoryId: 1
    },
    queries: {
    /**
    * The "newsfeed" query will concatenate the next Story to the current newsfeed, and returns
    * the updated newsfeed in a Promise.
    */
    newsfeed (queryParams) {
    return (
    Story.getQuery(
    "story", {storyId: queryParams.nextStoryId}
    ).then((nextStory) => {
    return queryParams.currentNewsfeed.concat([nextStory]);
    })
    );
    }
    }
    });
  • const newsfeed = this.props.newsfeed;
  • nextStoryId: this.props.queryParams.nextStoryId + 1

Where do the invocations of each function in the fragments object of createContainer get their parameters (their input values)?

Thank you.

@ghost ghost changed the title variables in fragments never get updated. Parameters in fragments never get updated. Mar 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
and others