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

When using FastRender.onAllRoutes and FastRender.route, subscriptions with same name are only concidered once #24

Open
macrozone opened this issue Oct 14, 2018 · 1 comment

Comments

@macrozone
Copy link

macrozone commented Oct 14, 2018

reproduction:

FastRender.onAllRoutes(function() {
   this.subscribe("my-subscription", "a");
})

FastRender.route('/foo', function() {
    this.subscribe("my-subscription", "b");
});

then only my-subscription with param b will end up in the injected data.

EDIT:

acutally, the data is there, but in the injected data you will find only one subscription as done:

"subscriptions": {
      "my-subscription": {
        "[\"b\"]": true
      },
    },

a is missing there

@macrozone macrozone changed the title When using FastRender.onAllRoutes and FastRender.route subscriptions with same name are only concidered once When using FastRender.onAllRoutes and FastRender.route, subscriptions with same name are only concidered once Oct 14, 2018
@macrozone
Copy link
Author

maybe its somewhat related to #23

but my current workaround in my SSR code:


 FastRender._mergeFrData(
          sink.request,
          FastRender.frContext.get().getData()
        )
        const payload = `<script type="text/inject-data">${InjectData.encode(
          sink.request.headers._injectPayload
        )}</script>`;

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

1 participant