How to use the most.map function in most

To help you get started, we’ve selected a few most examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Wonder-Technology / Wonder-Editor / lib / es6_global / src / core / utils / engine / MainUtils.js View on Github external
function init(editorState) {
  return Most.drain(Most.map((function (editEngineState) {
                        StateEngineService$WonderEditor.setIsDebug(true);
                        var match = GameObjectEngineService$WonderEditor.create(editEngineState);
                        var scene = match[1];
                        var match$1 = DefaultSceneUtils$WonderEditor.prepareSpecificGameObjectsForEditEngineState(scene, match[0]);
                        var match$2 = DefaultSceneUtils$WonderEditor.computeDiffValue(editorState, match$1[0]);
                        var match$3 = DefaultSceneUtils$WonderEditor.createDefaultScene(scene, match$2[1]);
                        var editEngineState$1 = DirectorEngineService$WonderEditor.init(GameObjectUtils$WonderEditor.setParentKeepOrder(match$3[1], match$1[1], GameObjectEngineService$WonderEditor.setGameObjectName("scene", scene, match$3[0])));
                        StateLogicService$WonderEditor.setEditEngineState(DirectorEngineService$WonderEditor.loopBody(0, InitEventUtils$WonderEditor.initEvent(ViewService$Wonderjs.unsafeGetCanvas(editEngineState$1[/* viewRecord */8]), EngineStateDataEditorService$WonderEditor.getEditEngineStateData(/* () */0), /* tuple */[
                                      StateEngineService$WonderEditor.getStateFromData,
                                      StateEngineService$WonderEditor.setStateToData
                                    ], editEngineState$1)));
                        StateEditorService$WonderEditor.setState(match$2[0]);
                        return /* () */0;
                      }), _getLoadData("edit")).concat(Most.map((function (runEngineState) {
                          var editorState = StateEditorService$WonderEditor.getState(/* () */0);
                          var match = GameObjectEngineService$WonderEditor.create(runEngineState);
                          var scene = match[1];
                          var match$1 = DefaultSceneUtils$WonderEditor.createDefaultScene(scene, match[0]);
                          var runEngineState$1 = DirectorEngineService$WonderEditor.init(GameObjectEngineService$WonderEditor.setGameObjectName("scene", scene, match$1[0]));
                          StateLogicService$WonderEditor.setRunEngineState(DirectorEngineService$WonderEditor.loopBody(0, InitEventUtils$WonderEditor.initEvent(ViewService$Wonderjs.unsafeGetCanvas(runEngineState$1[/* viewRecord */8]), EngineStateDataEditorService$WonderEditor.getRunEngineStateData(/* () */0), /* tuple */[
                                        StateEngineService$WonderEditor.getStateFromData,
                                        StateEngineService$WonderEditor.setStateToData
                                      ], runEngineState$1)));
                          StateEditorService$WonderEditor.setState(SceneEditorService$WonderEditor.setScene(scene, editorState));
                          return /* () */0;
                        }), _getLoadData("run")))).then((function () {
                return Promise.resolve(StateEditorService$WonderEditor.getState(/* () */0));
              }));
}
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset / ConfigDataLoaderSystem.js View on Github external
function _createFetchNoWorkerJobStreamArr(dataDir, fetchFunc) {
  return /* array */[
          Most.map(ParseNoWorkerJobService$Wonderjs.convertSettingToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/setting/setting.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertInitPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/pipeline/init_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertLoopPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/pipeline/loop_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertInitJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/job/init_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertLoopJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset / ConfigDataLoaderSystem.js View on Github external
dataDir,
                        "worker/setting/setting.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainInitPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/main/main_init_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainLoopPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/main/main_loop_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainInitJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/main/main_init_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainLoopJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/main/main_loop_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertWorkerPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/worker/worker_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertWorkerJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/worker/worker_jobs.json"
                      ]), fetchFunc))
        ];
}
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset / ConfigDataLoaderSystem.js View on Github external
dataDir,
                        "no_worker/setting/setting.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertInitPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/pipeline/init_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertLoopPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/pipeline/loop_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertInitJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/job/init_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseNoWorkerJobService$Wonderjs.convertLoopJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "no_worker/job/loop_jobs.json"
                      ]), fetchFunc))
        ];
}
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset / ConfigDataLoaderSystem.js View on Github external
function _createFetchRenderConfigStreamArr(dataDir, fetchFunc) {
  return /* array */[
          Most.map(ParseRenderConfigService$Wonderjs.convertShadersToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "render/shader/shaders.json"
                      ]), fetchFunc)),
          Most.map(ParseRenderConfigService$Wonderjs.convertShaderLibsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "render/shader/shader_libs.json"
                      ]), fetchFunc))
        ];
}
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset / ConfigDataLoaderSystem.js View on Github external
dataDir,
                        "worker/pipeline/main/main_init_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainLoopPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/main/main_loop_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainInitJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/main/main_init_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainLoopJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/main/main_loop_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertWorkerPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/worker/worker_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertWorkerJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/worker/worker_jobs.json"
                      ]), fetchFunc))
        ];
}
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset_bundle / import / ImportABSystem.js View on Github external
return Most.flatMap((function (rabRelativePath) {
                var state = StateDataMainService$Wonderjs.unsafeGetState(StateDataMain$Wonderjs.stateData);
                var match = OperateRABAssetBundleMainService$Wonderjs.isLoaded(rabRelativePath, state);
                if (match) {
                  return Most.empty();
                } else {
                  return Most.map((function (param) {
                                return /* () */0;
                              }), Most.tap((function (rab) {
                                    var state = StateDataMainService$Wonderjs.unsafeGetState(StateDataMain$Wonderjs.stateData);
                                    StateDataMainService$Wonderjs.setState(StateDataMain$Wonderjs.stateData, OperateRABAssetBundleMainService$Wonderjs.setLoadedRAB(rabRelativePath, rab, OperateRABAssetBundleMainService$Wonderjs.markLoaded(rabRelativePath, state)));
                                    return /* () */0;
                                  }), loadAB(rabRelativePath, wholeManifest, wholeDependencyRelationMap, /* tuple */[
                                      getAssetBundlePathFunc,
                                      isAssetBundleArrayBufferCachedFunc,
                                      getAssetBundleArrayBufferCacheFunc,
                                      cacheAssetBundleArrayBufferFunc,
                                      fetchFunc
                                    ])));
                }
              }), Most.just(rabRelativePath));
}
github Wonder-Technology / Wonder.js / lib / es6_global / src / asset / ConfigDataLoaderSystem.js View on Github external
function _createFetchWorkerJobStreamArr(dataDir, fetchFunc) {
  return /* array */[
          Most.map(ParseWorkerJobService$Wonderjs.convertSettingToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/setting/setting.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainInitPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/main/main_init_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainLoopPipelinesToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/pipeline/main/main_loop_pipelines.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainInitJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
                        dataDir,
                        "worker/job/main/main_init_jobs.json"
                      ]), fetchFunc)),
          Most.map(ParseWorkerJobService$Wonderjs.convertMainLoopJobsToRecord, FetchCommon$Wonderjs.createFetchJsonStream(PathService$Wonderjs.join(/* array */[
github motorcyclejs / motorcyclejs / examples / todo-app / src / application / makeApplication.ts View on Github external
function itemCounts(todos$: Stream>) {
  const activeTodoItemCount$ =
    map(length, map(filter((todo) => !todo.completed), todos$))

  const completedTodoItemCount$ =
    map(length, map(filter((todo) => todo.completed), todos$))

  const todoItemCount$ = map(length, todos$)

  return {
    activeTodoItemCount$,
    completedTodoItemCount$,
    todoItemCount$,
  }
}
github motorcyclejs / motorcyclejs / examples / todo-app / src / ui / TodoApp / TodoApp.ts View on Github external
export function TodoApp(sources: Sources): Sinks {
  const {
    dom,
    todos$,
    activeTodoItemCount$,
    completedTodoItemCount$,
    todoItemCount$,
  } = sources

  const addTodo$ = newTodo(dom)
  const clearCompletedTodos$ = clearCompleted(dom)

  const todoItemSinks$: Stream> =
    hold(map(rMap(toTodoItem(dom)), todos$))

  const todoItemView$s$ =
    mapProp('view$', todoItemSinks$)

  const todoItemViews$ = startWith([], switchCombine(todoItemView$s$))

  const todoItemRemove$s$ =
    mapProp('remove$', todoItemSinks$)

  const removeTodo$ = switchMerge(todoItemRemove$s$)

  const todoItemUpdate$s$ =
    mapProp('update$', todoItemSinks$)

  const updateTodo$ = switchMerge(todoItemUpdate$s$)