MCPcopy Create free account
hub / github.com/microsoft/SandDance / constructor

Method constructor

packages/sanddance-app/src/sanddanceApp.tsx:90–112  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

88 public explorer: Explorer_Class;
89
90 constructor(props: Props) {
91 super(props);
92 this.state = {
93 compactUI: !!localStorage.getItem('compactUI'),
94 dialogMode: null,
95 dataSource: snapshotOnLoad && snapshotOnLoad.dataSource || props.dataSources[0],
96 darkTheme: props.darkTheme,
97 };
98 this.viewerOptions = getViewerOptions(this.state.darkTheme, props.themeColors);
99 this.handlers = {
100 hashchange: e => {
101 const snapshot = getSnapshotFromHash();
102 if (snapshot) {
103 this.explorer && this.explorer.calculate(() => this.hydrateSnapshot(snapshot));
104 }
105 },
106 resize: e => {
107 this.explorer && this.explorer.resize();
108 },
109 };
110 this.wireEventHandlers(true);
111 this.changeColorScheme(this.state.darkTheme);
112 }
113
114 private wireEventHandlers(add: boolean) {
115 for (const key in this.handlers) {

Callers

nothing calls this directly

Calls 7

hydrateSnapshotMethod · 0.95
wireEventHandlersMethod · 0.95
changeColorSchemeMethod · 0.95
getViewerOptionsFunction · 0.70
getSnapshotFromHashFunction · 0.70
calculateMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected