This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this lacks subscribe behavior or ability to dispatch from outside of component tree but that is generally not neccesary */ | |
class State extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = YOUR_INITIAL_STATE; | |
} | |
reducer = (action, state, props) => {...newState}; | |
/* setState takes an object of new state as first arg or a function of props and state that returns new state | |
* which we will use here | |
* we pass dispatch around and use it similarly to redux dispatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var noteValues = { | |
'C0': 16.35, | |
'C#0': 17.32, | |
'Db0': 17.32, | |
'D0': 18.35, | |
'D#0': 19.45, | |
'Eb0': 19.45, | |
'E0': 20.60, | |
'F0': 21.83, | |
'F#0': 23.12, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* AngularJS hack - This way we can get and decorate all custom directives | |
* in order to broadcast a custom directive events: $directiveAdd | |
**/ | |
// This is where all the custom directives will be stored | |
var $directives = []; | |
var originalModule = angular.module; | |
angular.module = function () { | |
var module = originalModule.apply(this, arguments); | |
var originalDirective = module.directive; |