Skip to content

Commit d8a6b7d

Browse files
committed
use shared view data during rendering
1 parent 2e7d216 commit d8a6b7d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/view/src/view-response.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ export class ViewResponse {
4141
* Assigns the rendered HTML of the given `template` as the response payload.
4242
*/
4343
private async renderView (template: string, data?: any, viewBuilder?: ViewBuilderCallback): Promise<string> {
44-
const viewData = { ...this.response.state().all(), ...data }
44+
const viewData = {
45+
...this.response.state().all(),
46+
...this.viewEngine.sharedData(),
47+
...data
48+
}
49+
4550
const viewConfig: ViewResponseConfig = {}
4651

4752
if (typeof viewBuilder === 'function') {

0 commit comments

Comments
 (0)