def on_message(self, message):
change = json.loads(message)<EOL>log.debug(f'<STR_LIT>')<EOL>ref = change.get('<STR_LIT>')<EOL>if not ref:<EOL><INDENT>return<EOL><DEDENT>nodes = self.viewer.xpath('<STR_LIT>', ref=ref)<EOL>if not nodes:<EOL><INDENT>return  <EOL><DEDENT>node = nodes[<NUM_LIT:0>]<EOL>if change.get('<STR_LIT:type>') and change.get('<STR_LIT:name>'):<EOL><INDENT>if change['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>trigger = getattr(node, change['<STR_LIT:name>'])<EOL>trigger()<EOL><DEDENT>elif change['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>setattr(node, change['<STR_LIT:name>'], change['<STR_LIT:value>'])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>log.warning(f"<STR_LIT>")<EOL><DEDENT>
When we get an event from js, lookup the node and invoke the
        action on the enaml node.