export default D.declare('view.cmp.Switch', (cfg, contentHash) => {
  const cmp = div( {
    cls: update => store.sub(
      cfg.key,
        val => update(
          D.cls(
            'cmp-switch',
            cfg.cls,
            { 'cmp-switch__filled': val in contentHash } ) ) ) } );

  store.sub( cfg.key, (val)=> {
    D.removeChildren(cmp);
    if(val in contentHash)
      D.appendChild( cmp, contentHash[ val ] );

  });

  return cmp;
});