- Убрали 100vw (потому что не на xs он ведет себя неправильно):
- Вынесли базовую реализацию DropBase и отдельные специфичные Menu, Info, Down в jsx
- Удалили lastMetrics
- Menu, Info и Down внутри себя работают через общий Base компонент, отличия в поведении описаны или в существующих параметрах, либо в behavior. behavior — это набор пресетов, таких как "размер стрелочки", "выравнивание", "оффсет для компонента" — т.е. мелкие стилевые и поведенческие отличия компонентов друг от друга
- Позиционирование между Menu, Down, Info стало более похожим, отличается только по behavior
- Избавились от customDistance — теперь за него также отвечает behavior
- Сделали правильное выравнивание для Menu и Down
- Починили анимашку у варинильных выпадающих элементов
- Ресетим позицию при ресайзе на ванильных реализациях
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const BATCH = 'BATCHING_ACTIONS'; | |
// actions — массив экшенов, вида [ | |
// {type: "actionType1", payload: {}, ...}, | |
// {type: "actionType2", payload: {}, ...}, | |
// ... | |
//] | |
// Функция формирует из custom action классический redux экшен, иначе, когда экшен дойдет до стора redux выдаст ошибку | |
export const batchActionCreator = (actions) => ({ | |
type: BATCH, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ResumeAboutMe(props) { | |
const [aboutMe] = useHighligted(props.aboutMe); | |
return ( | |
<div> | |
<HiglightedText>{aboutMe}</HiglightedText> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DeferredRender extends Component { | |
static defaultProps = { | |
countByStep: 100, | |
}; | |
state = { rendered: 0 }; | |
componentDidMount() { | |
this.nextStep(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With callbacs: | |
class List extends Component { | |
constructor(props) { | |
super(props); | |
props.items.map(item => | |
this.refsCallbacks[item.id] = (el) => this.refs.items[item.id] = el; | |
); | |
// also you can store refCallbacks in state. | |
} | |
componentWillReceiveProps(nextProps) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Наш модуль сможет работать как в node.js, так и в браузере | |
(function (global) { | |
if (global.setImmediate) { | |
return; | |
} | |
// оборачиваем присваивание в анонимную функцию, чтобы один раз найти нужный способ асинхронного вызова для платформы и использовать его. | |
global.setImmediate = (function() { | |
var list = []; | |
var addFunction = function(fn) { | |
return list.push(fn) - 1; |
NewerOlder