wonder.js
Version:
29 lines (24 loc) • 1.66 kB
JavaScript
'use strict';
var Curry = require("bs-platform/lib/js/curry.js");
var Log$WonderLog = require("wonder-log/lib/js/src/Log.js");
var Contract$WonderLog = require("wonder-log/lib/js/src/Contract.js");
var ArrayService$Wonderjs = require("../../atom/ArrayService.js");
var StateDataMain$Wonderjs = require("../../state/main/data/StateDataMain.js");
var IsDebugMainService$Wonderjs = require("../../state/main/state/IsDebugMainService.js");
var ArrayService$WonderCommonlib = require("wonder-commonlib/lib/js/src/ArrayService.js");
function checkComponentShouldAlive(component, isAliveFunc, record) {
return Contract$WonderLog.test(Log$WonderLog.buildAssertMessage("component alive", "not"), (function (param) {
return Contract$WonderLog.assertTrue(Curry._2(isAliveFunc, component, record));
}));
}
function getAllAliveComponents(index, disposedIndexArray) {
Contract$WonderLog.requireCheck((function (param) {
return Contract$WonderLog.test(Log$WonderLog.buildAssertMessage("disposedIndexArray not has duplicate items", "has"), (function (param) {
return Contract$WonderLog.Operators[/* = */0](ArrayService$WonderCommonlib.removeDuplicateItems(disposedIndexArray).length, disposedIndexArray.length);
}));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
return ArrayService$Wonderjs.fastExclude(disposedIndexArray.slice(), ArrayService$Wonderjs.range(0, index - 1 | 0));
}
exports.checkComponentShouldAlive = checkComponentShouldAlive;
exports.getAllAliveComponents = getAllAliveComponents;
/* Log-WonderLog Not a pure module */