separate out strudel.mjs, make index.mjs aggregate module

This commit is contained in:
alex 2022-04-13 17:25:02 +01:00
parent 0396c3f475
commit f75da0e2e3
21 changed files with 296 additions and 329 deletions

22
packages/core/state.mjs Normal file
View file

@ -0,0 +1,22 @@
export class State {
constructor(span, controls = {}) {
this.span = span;
this.controls = controls;
}
// Returns new State with different span
setSpan(span) {
return new State(span, this.controls);
}
withSpan(func) {
return this.setSpan(func(this.span));
}
// Returns new State with different controls
setControls(controls) {
return new State(this.span, controls);
}
}
export default State;