Last active
April 25, 2019 04:39
-
-
Save Sawtaytoes/63ed12678d9367e32f46c627d5e712b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 actions = { | |
UPDATE_IDS: function(action) { | |
vm.ids = action.ids | |
}, | |
UPDATE_PRIVILAGES: function(action) { | |
vm.privileges = action.privileges | |
}, | |
} | |
var dispatch = function( | |
action, | |
) { | |
if (!action.type) { | |
console | |
.error( | |
"No type for action", | |
action, | |
) | |
} | |
if (window.__isDebugging) { | |
console | |
.info( | |
action.type, | |
action, | |
) | |
} | |
actions[action.type] | |
&& actions[action.type](action) | |
return action | |
} | |
var vm = this | |
vm.onClick = function() { | |
idsService | |
.get() | |
.then(function(ids) { | |
dispatch({ | |
ids: ids, | |
type: 'UPDATE_IDS', | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment