mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
select up and down the inspector hierarchy
Summary: This allows you to select the displayed owner hierarchy, and see the styles, props, and position. @public Test Plan: Open the inspector, select something in the middle of the page. Click the breadcrumb train in the inspector, and verify that: - styles are reflected - margin/padding/box is correct - the highlight updates to show the selected item See video as well. [Video](https://www.latest.facebook.com/pxlcld/mqnl) Screenshot {F22518618}
This commit is contained in:
19
Libraries/Utilities/mapWithSeparator.js
Normal file
19
Libraries/Utilities/mapWithSeparator.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook. All Rights Reserved.
|
||||
*
|
||||
* @providesModule mapWithSeparator
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
function mapWithSeparator(array, valueFunction, separatorFunction) {
|
||||
var results = [];
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
results.push(valueFunction(array[i], i, array));
|
||||
if (i !== array.length - 1) {
|
||||
results.push(separatorFunction(i));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
module.exports = mapWithSeparator;
|
||||
Reference in New Issue
Block a user