Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arui-feather

Package Overview
Dependencies
Maintainers
5
Versions
268
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arui-feather - npm Package Compare versions

Comparing version 9.10.3 to 9.10.4

lib/match-media.js

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="9.10.4"></a>
## [9.10.4](https://github.com/alfa-laboratory/arui-feather/compare/v9.10.3...v9.10.4) (2017-09-29)
### Bug Fixes
* **mq:** move match media utils functions to lib ([#228](https://github.com/alfa-laboratory/arui-feather/issues/228)) ([52acf1d](https://github.com/alfa-laboratory/arui-feather/commit/52acf1d))
<a name="9.10.3"></a>

@@ -2,0 +12,0 @@ ## [9.10.3](https://github.com/alfa-laboratory/arui-feather/compare/v9.10.2...v9.10.3) (2017-09-29)

4

mq/mq.d.ts
import { Component, ReactNode } from 'react';
export type MqChildrenFieldType = Array<ReactNode> | ReactNode;
export interface MqProps {

@@ -20,3 +20,3 @@

*/
children?: MqChildrenFieldType;
children?: ReactNode;
/**

@@ -23,0 +23,0 @@ * Обработчик изменений в совпадении запросов

@@ -27,6 +27,4 @@ 'use strict';

var _mq = require('./mq.json');
var _matchMedia = require('../lib/match-media');
var _mq2 = _interopRequireDefault(_mq);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -72,29 +70,2 @@

var pool = {};
var refCounters = {};
function getMatchMedia(queryProp) {
var query = _mq2.default[queryProp] || queryProp;
if (!pool[query]) {
pool[query] = window.matchMedia(query);
refCounters[query] = 1;
} else {
refCounters[query] += 1;
}
return pool[query];
}
function releaseMatchMedia(queryProp) {
var query = _mq2.default[queryProp] || queryProp;
refCounters[query] -= 1;
if (pool[query] && refCounters[query] === 0) {
delete pool[query];
delete refCounters[query];
}
}
/**

@@ -129,3 +100,3 @@ * Компонент, имплементирующий поддержку медиа запросов в шаблонах.

value: function componentDidMount() {
this.mql = getMatchMedia(this.props.query);
this.mql = (0, _matchMedia.getMatchMedia)(this.props.query);
this.mql.addListener(this.handleMatch);

@@ -137,3 +108,3 @@ this.handleMatch(this.mql);

value: function componentWillUnmount() {
releaseMatchMedia(this.props.query);
(0, _matchMedia.releaseMatchMedia)(this.props.query);
this.mql.removeListener(this.handleMatch);

@@ -188,3 +159,3 @@ this.mql = null;

/** Дочерние элементы `Mq` */
children: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.node), _propTypes2.default.node]),
children: _propTypes2.default.node,
/** Обработчик изменений в совпадении запросов */

@@ -191,0 +162,0 @@ onMatchChange: _propTypes2.default.func

{
"name": "arui-feather",
"version": "9.10.3",
"version": "9.10.4",
"description": "Alfa-Bank UI lightweight library",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc