2024-03-15 09:50:17 +01:00

12 lines
301 B
JavaScript

import { registerWidgetType } from '@strudel/transpiler';
import { Pattern } from '@strudel/core';
export function registerWidget(type, fn) {
registerWidgetType(type);
if (fn) {
Pattern.prototype[type] = function (id, options = { fold: 1 }) {
return fn(id, options, this);
};
}
}