mapcomplete/Logic/Actors/HistoryHandling.ts

19 lines
523 B
TypeScript
Raw Normal View History

2021-01-08 17:02:07 +00:00
import {UIEventSource} from "../UIEventSource";
import {UIElement} from "../../UI/UIElement";
export default class HistoryHandling {
constructor(hash: UIEventSource<string>, fullscreenMessage: UIEventSource<{ content: UIElement, hashText: string }>) {
hash.addCallback(h => {
if (h === undefined || h === "") {
fullscreenMessage.setData(undefined);
}
})
2021-01-21 22:39:31 +00:00
2021-01-08 17:02:07 +00:00
fullscreenMessage.addCallback(fs => {
hash.setData(fs?.hashText);
})
2021-01-21 22:39:31 +00:00
2021-01-08 17:02:07 +00:00
}
}