Skip to content

Instantly share code, notes, and snippets.

@ckknight
Created October 16, 2015 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckknight/85f8ecfa862e26c9a725 to your computer and use it in GitHub Desktop.
Save ckknight/85f8ecfa862e26c9a725 to your computer and use it in GitHub Desktop.
import Immutable from 'immutable';
const { Record } = Immutable;
declare class ImmEulerRecordClass extends Record {
x: number;
y: number;
z: number;
order: string;
}
const ImmEulerRecord: Class<ImmEulerRecordClass> = new Record({ // eslint-disable-line no-undef
x: 0,
y: 0,
z: 0,
order: 'XYZ',
});
/**
* Represents an Immutable Euler, similar to THREE.Euler
*/
export default class ImmEuler extends ImmEulerRecord {
/**
* Converts from an object to an ImmEuler
*/
static from(source: any): ImmEuler {
return new this().merge(source);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment