Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 366a8b4

Browse files
author
Guillaume Chau
committed
chore: rename onRenderComplete to rendered
1 parent 99765c7 commit 366a8b4

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

‎src/server/create-renderer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export function createRenderer ({
7979
}, cb)
8080
try {
8181
render(component, write, context, err => {
82-
if (context && context.onRenderComplete) {
83-
context.onRenderComplete(context)
82+
if (context && context.rendered) {
83+
context.rendered(context)
8484
}
8585
if (template) {
8686
result = templateRenderer.renderSync(result, context)
@@ -109,9 +109,9 @@ export function createRenderer ({
109109
render(component, write, context, done)
110110
})
111111
if (!template) {
112-
if (context && context.onRenderComplete) {
112+
if (context && context.rendered) {
113113
renderStream.once('beforeEnd', () => {
114-
context.onRenderComplete(context)
114+
context.rendered(context)
115115
})
116116
}
117117
return renderStream
@@ -121,9 +121,9 @@ export function createRenderer ({
121121
templateStream.emit('error', err)
122122
})
123123
renderStream.pipe(templateStream)
124-
if (context && context.onRenderComplete) {
124+
if (context && context.rendered) {
125125
renderStream.once('beforeEnd', () => {
126-
context.onRenderComplete(context)
126+
context.rendered(context)
127127
})
128128
}
129129
return templateStream

‎test/ssr/ssr-stream.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ describe('SSR: renderToStream', () => {
103103
stream2.read(1)
104104
})
105105

106-
it('should call context.onRenderComplete', done => {
106+
it('should call context.rendered', done => {
107107
let a = 0
108108
const stream = renderToStream(new Vue({
109109
template: `
110110
<div>Hello</div>
111111
`
112112
}), {
113-
onRenderComplete: () => {
113+
rendered: () => {
114114
a = 42
115115
}
116116
})

‎test/ssr/ssr-string.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,12 +1450,12 @@ describe('SSR: renderToString', () => {
14501450
})
14511451
})
14521452

1453-
it('should call context.onRenderComplete', done => {
1453+
it('should call context.rendered', done => {
14541454
let a = 0
14551455
renderToString(new Vue({
14561456
template: '<div>Hello</div>'
14571457
}), {
1458-
onRenderComplete: () => {
1458+
rendered: () => {
14591459
a = 42
14601460
}
14611461
}, (err, res) => {

‎test/ssr/ssr-template.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('SSR: template option', () => {
9999
})
100100
})
101101

102-
it('renderToString with interpolation and context.onRenderComplete', done => {
102+
it('renderToString with interpolation and context.rendered', done => {
103103
const renderer = createRenderer({
104104
template: interpolateTemplate
105105
})
@@ -110,7 +110,7 @@ describe('SSR: template option', () => {
110110
head: '<meta name="viewport" content="width=device-width">',
111111
styles: '<style>h1 { color: red }</style>',
112112
state: { a: 0 },
113-
onRenderComplete: context => {
113+
rendered: context => {
114114
context.state.a = 1
115115
}
116116
}
@@ -201,7 +201,7 @@ describe('SSR: template option', () => {
201201
})
202202
})
203203

204-
it('renderToStream with interpolation and context.onRenderComplete', done => {
204+
it('renderToStream with interpolation and context.rendered', done => {
205205
const renderer = createRenderer({
206206
template: interpolateTemplate
207207
})
@@ -212,7 +212,7 @@ describe('SSR: template option', () => {
212212
head: '<meta name="viewport" content="width=device-width">',
213213
styles: '<style>h1 { color: red }</style>',
214214
state: { a: 0 },
215-
onRenderComplete: context => {
215+
rendered: context => {
216216
context.state.a = 1
217217
}
218218
}

0 commit comments

Comments
 (0)