mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] benchmarks: two small fixes
This commit is contained in:
@@ -49,11 +49,12 @@ class App extends owl.Component {
|
|||||||
|
|
||||||
updateSomeMessages() {
|
updateSomeMessages() {
|
||||||
startMeasure("update every 10th");
|
startMeasure("update every 10th");
|
||||||
|
const setState = owl.Observer.set;
|
||||||
const messages = this.state.messages;
|
const messages = this.state.messages;
|
||||||
for (let i = 0; i < this.state.messages.length; i += 10) {
|
for (let i = 0; i < this.state.messages.length; i += 10) {
|
||||||
const msg = Object.assign({}, messages[i]);
|
const msg = Object.assign({}, messages[i]);
|
||||||
msg.author += '!!!';
|
msg.author += '!!!';
|
||||||
this.set(messages, i, msg);
|
setState(messages, i, msg);
|
||||||
}
|
}
|
||||||
stopMeasure();
|
stopMeasure();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div t-name="Message" class="message">
|
<div t-name="Message" class="message">
|
||||||
<span class="author"><t t-esc="props.author"/></span>
|
<span class="author"><t t-esc="props.message.author"/></span>
|
||||||
<span class="msg"><t t-esc="props.msg"/></span>
|
<span class="msg"><t t-esc="props.message.msg"/></span>
|
||||||
<button class="remove" t-on-click="removeMessage">Remove</button>
|
<button class="remove" t-on-click="removeMessage">Remove</button>
|
||||||
<t t-widget="Counter"/>
|
<t t-widget="Counter"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -32,8 +32,8 @@ class OWLHandler(SimpleHTTPRequestHandler):
|
|||||||
OWLHandler.extensions_map['.js'] = 'application/javascript'
|
OWLHandler.extensions_map['.js'] = 'application/javascript'
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("Owl Extras")
|
print("Owl Tools")
|
||||||
print("----------")
|
print("---------")
|
||||||
print("Server running on: {}".format(URL))
|
print("Server running on: {}".format(URL))
|
||||||
httpd = HTTPServer((HOST, PORT), OWLHandler)
|
httpd = HTTPServer((HOST, PORT), OWLHandler)
|
||||||
threading.Thread(target=httpd.serve_forever, daemon=True).start()
|
threading.Thread(target=httpd.serve_forever, daemon=True).start()
|
||||||
|
|||||||
Reference in New Issue
Block a user