
ctrl+k
Enter a search term above to see results...
Enter a search term above to see results...
Date Helpers are methods available on Signal instances that contain Date objects. These helpers provide a convenient way to update the date value reactively.
Sets the value of the Signal to the current date and time.
signal.now()
Date - The new Date object representing the current date and time.
import { Signal } from '@semantic-ui/reactivity';
const currentTime = new Signal(new Date());
console.log(currentTime.get()); // Output: current date and time
// After some time...currentTime.now();console.log(currentTime.get()); // Output: updated current date and time
now()
method is particularly useful when you need to update a reactive date variable to the current time, such as for timestamps or when refreshing time-based data.now()
will trigger any reactive computations that depend on this variable.now()
was called, not when it’s later accessed.