Skip to content

Instantly share code, notes, and snippets.

View dominicglenn's full-sized avatar

Dominic Santos dominicglenn

View GitHub Profile
@dominicglenn
dominicglenn / shared-state-behavior.html
Last active December 8, 2016 22:19
A way of having global state that can be read and written to separately per component
<script>
StateReceiverBehavior = {
attached: function() {
var component = this;
Object.keys(component.properties).forEach(function(propertyName){
var property = component.properties[propertyName];
if(property.linkState){
component.set(propertyName, window.AppStateComponent.get(property.linkState));