slate/workers/filter-files.js

9 lines
289 B
JavaScript

import { getFilterHandler } from "~/common/filter-utilities";
onmessage = function (e) {
const { objects = [], view, subview, type } = e.data;
const filterCallback = getFilterHandler({ view, subview, type });
const result = objects.filter(filterCallback);
postMessage(result);
};