feat(spec): add new specJS selector (#8936)
This selector always returns the same JavaScript object unless it really changes. Before this change it customary to call specJson().toJS() which always resulted in transformation operation and new JavaScript object. Refs #8606
This commit is contained in:
@@ -238,7 +238,7 @@ const debResolveSubtrees = debounce(async () => {
|
||||
}
|
||||
}, Promise.resolve({
|
||||
resultMap: (specSelectors.specResolvedSubtree([]) || Map()).toJS(),
|
||||
specWithCurrentSubtrees: specSelectors.specJson().toJS()
|
||||
specWithCurrentSubtrees: specSelectors.specJS()
|
||||
}))
|
||||
|
||||
delete requestBatch.system
|
||||
|
||||
@@ -38,6 +38,11 @@ export const specJson = createSelector(
|
||||
spec => spec.get("json", Map())
|
||||
)
|
||||
|
||||
export const specJS = createSelector(
|
||||
specJson,
|
||||
(spec) => spec.toJS()
|
||||
)
|
||||
|
||||
export const specResolved = createSelector(
|
||||
state,
|
||||
spec => spec.get("resolved", Map())
|
||||
|
||||
Reference in New Issue
Block a user