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() {
|
||||
startMeasure("update every 10th");
|
||||
const setState = owl.Observer.set;
|
||||
const messages = this.state.messages;
|
||||
for (let i = 0; i < this.state.messages.length; i += 10) {
|
||||
const msg = Object.assign({}, messages[i]);
|
||||
msg.author += '!!!';
|
||||
this.set(messages, i, msg);
|
||||
setState(messages, i, msg);
|
||||
}
|
||||
stopMeasure();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
</div>
|
||||
|
||||
<div t-name="Message" class="message">
|
||||
<span class="author"><t t-esc="props.author"/></span>
|
||||
<span class="msg"><t t-esc="props.msg"/></span>
|
||||
<span class="author"><t t-esc="props.message.author"/></span>
|
||||
<span class="msg"><t t-esc="props.message.msg"/></span>
|
||||
<button class="remove" t-on-click="removeMessage">Remove</button>
|
||||
<t t-widget="Counter"/>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ class OWLHandler(SimpleHTTPRequestHandler):
|
||||
OWLHandler.extensions_map['.js'] = 'application/javascript'
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Owl Extras")
|
||||
print("----------")
|
||||
print("Owl Tools")
|
||||
print("---------")
|
||||
print("Server running on: {}".format(URL))
|
||||
httpd = HTTPServer((HOST, PORT), OWLHandler)
|
||||
threading.Thread(target=httpd.serve_forever, daemon=True).start()
|
||||
|
||||
Reference in New Issue
Block a user