global:Router = require('pro-router') require './ref/ref' require './switch/switch' require './not_found/not_found' tag router prop component watch: yes def setup @r = R @component = null @cache = {} def componentDidSet val, prev removeChild(prev) if prev appendChild(val) if val self def render var view = @data || @r:view component = @cache[view] ||= Imba.createElement(view,null,null,self) component.end