# hyperobj-context **Repository Path**: mirrors_regular/hyperobj-context ## Basic Information - **Project Name**: hyperobj-context - **Description**: Nested hyperscript contexts for hyperobj - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-05-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # hyperobj-context Nested hyperscript contexts for hyperobj ``` js const hs = require('hyperscript-nested-contexts')(require('hyperscript')) const ho = require('hyperobj-context')(require('hyperobj'), hs) const observable = require('observable') const render = ho( function(v) { if (typeof v!=='object') return const h = this.ctx || hs return h('ol', Object.keys(v).map( (k)=> { const msg = observable() return ((h)=>{ msg('clickme') return h('li', [ h('em.key', h('span', msg), this.call(this, k), { onclick: function() { msg('I was clicked') h.cleanup() } }), h('span.value', this.call(this, v[k], k)) ]) })(this.pushContext(h.context())) this.popContext() }) ) }, function(v) { const h = this.ctx || hs return h('span.string', v) } ) document.body.appendChild( render(require('./package.json')) ) ```