@bem-react/di
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -110,7 +110,8 @@ 'use strict'; | ||
exports.ComponentRegistryConsumer = ComponentRegistryConsumer; | ||
exports.Registry = Registry; | ||
exports.RegistryConsumer = RegistryConsumer; | ||
exports.registryContext = registryContext; | ||
exports.useComponentRegistry = useComponentRegistry; | ||
exports.useRegistries = useRegistries; | ||
exports.withRegistry = withRegistry; | ||
exports.ComponentRegistryConsumer = ComponentRegistryConsumer; | ||
exports.useRegistries = useRegistries; | ||
exports.useComponentRegistry = useComponentRegistry; | ||
exports.Registry = Registry; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),__assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},registryContext=React.createContext({}),RegistryProvider=registryContext.Provider,RegistryConsumer=registryContext.Consumer;function withRegistry(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r=function(r){return React.createElement(RegistryConsumer,null,function(n){var s=__assign({},n);return e.forEach(function(e){var t=n[e.id];s[e.id]=e.overridable?t?e.merge(t):e:e&&t?t.merge(e):e}),React.createElement(RegistryProvider,{value:s},React.createElement(t,__assign({},r)))})};return r.displayName="RegistryResolver("+e.map(function(e){return e.id}).join(", ")+")",r}}var ComponentRegistryConsumer=function(e){return React.createElement(RegistryConsumer,null,function(t){return e.children(t[e.id].snapshot())})},useRegistries=function(){return React.useContext(registryContext)},useComponentRegistry=function(e){return useRegistries()[e].snapshot()},Registry=function(){function e(e){var t=e.id,r=e.overridable,n=void 0===r||r;this.components={},this.id=t,this.overridable=n}return e.prototype.set=function(e,t){return this.components[e]=t,this},e.prototype.get=function(e){return this.components[e]},e.prototype.snapshot=function(){return this.components},e.prototype.merge=function(t){var r=new e({id:this.id,overridable:this.overridable});return r.components=__assign({},this.components,t?t.snapshot():{}),r},e}();exports.RegistryConsumer=RegistryConsumer,exports.withRegistry=withRegistry,exports.ComponentRegistryConsumer=ComponentRegistryConsumer,exports.useRegistries=useRegistries,exports.useComponentRegistry=useComponentRegistry,exports.Registry=Registry; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),__assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},registryContext=React.createContext({}),RegistryProvider=registryContext.Provider,RegistryConsumer=registryContext.Consumer;function withRegistry(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r=function(r){return React.createElement(RegistryConsumer,null,function(n){var s=__assign({},n);return e.forEach(function(e){var t=n[e.id];s[e.id]=e.overridable?t?e.merge(t):e:e&&t?t.merge(e):e}),React.createElement(RegistryProvider,{value:s},React.createElement(t,__assign({},r)))})};return r.displayName="RegistryResolver("+e.map(function(e){return e.id}).join(", ")+")",r}}var ComponentRegistryConsumer=function(e){return React.createElement(RegistryConsumer,null,function(t){return e.children(t[e.id].snapshot())})},useRegistries=function(){return React.useContext(registryContext)},useComponentRegistry=function(e){return useRegistries()[e].snapshot()},Registry=function(){function e(e){var t=e.id,r=e.overridable,n=void 0===r||r;this.components={},this.id=t,this.overridable=n}return e.prototype.set=function(e,t){return this.components[e]=t,this},e.prototype.get=function(e){return this.components[e]},e.prototype.snapshot=function(){return this.components},e.prototype.merge=function(t){var r=new e({id:this.id,overridable:this.overridable});return r.components=__assign({},this.components,t?t.snapshot():{}),r},e}();exports.ComponentRegistryConsumer=ComponentRegistryConsumer,exports.Registry=Registry,exports.RegistryConsumer=RegistryConsumer,exports.registryContext=registryContext,exports.useComponentRegistry=useComponentRegistry,exports.useRegistries=useRegistries,exports.withRegistry=withRegistry; |
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.0.2](https://github.com/bem/bem-react/compare/@bem-react/di@2.0.1...@bem-react/di@2.0.2) (2019-07-31) | ||
**Note:** Version bump only for package @bem-react/di | ||
## [2.0.1](https://github.com/bem/bem-react/compare/@bem-react/di@2.0.0...@bem-react/di@2.0.1) (2019-05-27) | ||
@@ -8,0 +16,0 @@ |
import React, { ReactNode, FC, ComponentType } from 'react'; | ||
export declare type RegistryContext = Record<string, Registry>; | ||
export declare const registryContext: React.Context<Record<string, Registry>>; | ||
export declare const RegistryConsumer: React.ExoticComponent<React.ConsumerProps<Record<string, Registry>>>; | ||
@@ -4,0 +5,0 @@ export declare function withRegistry(...registries: Registry[]): <P>(Component: React.ComponentType<P>) => React.FunctionComponent<P>; |
{ | ||
"name": "@bem-react/di", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "BEM React Dependency Injection", | ||
@@ -51,3 +51,3 @@ "homepage": "https://github.com/bem/bem-react/tree/master/packages/di", | ||
}, | ||
"gitHead": "f10e99bce98bbd563427c7eacc9a8a4ccae07007" | ||
"gitHead": "85ac37ac16d19119736bcb7248991efe68e04e05" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20881
169