How would you write this in ES6?

Given this boiler plate ES5 example:

var Turning = pc.createScript('turn');

// define `speed` attribute that is available in Editor UI
Turning.attributes.add('speed', {
    type: 'number',
    default: 180,
    placeholder: 'deg/s'

// runs every tick
Turning.prototype.update = function(dt) {
    this.entity.rotate(0, this.speed * dt, 0);

How would you write it using the new ES6 features such as arrow functions, classes etc.?

Well that’s an excellent question @neoflash ! You’re so smart to think of these amazing questions. You’ll find your answer in this other wonderful forum post: I’ve finally figured out how to use ES6 classes with PlayCanvas