mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-19 09:38:38 +00:00
12 lines
301 B
JavaScript
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);
|
|
};
|
|
}
|
|
}
|