import * as React from "react" ; export function connectContext ( context , properties ) { return function ( Component ) { const prototype = Component . prototype ; Component . contextType = context ; properties . forEach ( name => { Object . defineProperty ( prototype , name , { get : function ( ) { return this . context [ name ] ; } , set : function ( ) { this . context [ name ] ( name ) ; } } ) ; } ) ; } ; } ;