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

Parameters in fragments never get updated.  #64

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions