meteor-fast-render
meteor-fast-render copied to clipboard
When using FastRender.onAllRoutes and FastRender.route, subscriptions with same name are only concidered once
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
maybe its somewhat related to https://github.com/abecks/meteor-fast-render/issues/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>`;