Skip to content

Rx pushing data through React-Router #1230

@Cmdv

Description

@Cmdv

I have a react App with the data flow being driven by RxJS -> here

Short of it is I subscribe to my data store which I then pump through via the props:

Model.subject.subscribe((appState) => {
  React.render(
    <App {...appState}/>,
    document.getElementById('app')
  );
});

Now is there a way I can merge the above subscription into the Router.run..?

Router.run(routes, function (Handler) {
  React.render(
    <Handler />,
    document.getElementById('app')
  );
});

I've tried the bellow the router still works but the appState isn't been passed through!!

 Model.subject.subscribe((appState) => {
  Router.run(routes, function (Handler) {
    React.render(
      <Handler {...appState}/>,
      document.getElementById('app')
    );
  });
});

Any pointers would be superb thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions