MCPcopy Create free account
hub / github.com/objectivehtml/FlipClock / constructor

Method constructor

src/faces/Clock.ts:70–90  ·  view source on GitHub ↗

* Instantiate the clock face. * * @public

(props?: ClockProps)

Source from the content-addressed store, hash-verified

68 * @public
69 */
70 constructor(props?: ClockProps) {
71 this.date = props?.date ?? new Date();
72
73 if (props?.format) {
74 this.format = props.format;
75 }
76
77 if (props?.formatter === undefined) {
78 this.formatter = useDateFormats();
79 }
80 else if ('format' in props.formatter) {
81 this.formatter = props.formatter;
82 }
83 else {
84 this.formatter = useDateFormats(props.formatter);
85 }
86
87 this.value = createRoot(() => {
88 return faceValue(this.formatter.format(this.date, this.format));
89 });
90 }
91
92 /**
93 * The face's current value.

Callers

nothing calls this directly

Calls 3

useDateFormatsFunction · 0.90
faceValueFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected