
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ember-cli-clock
Advanced tools
A very simple observable clock service for EmberJS.
I display time in many of my projects and need to keep the displayed time up-to-date so I generalized the solution to this Ember CLI Add-on.
npm install --save-dev ember-cli-clock
The clock
service is injected into all controllers. This means
you can observe changes like so for use with MomentJS:
App.MessageController = Ember.Controller.extend({
posted: function() {
return moment(this.get('timestamp')).fromNow();
}.property('clock.minute')
});
{{posted}} outputs "2 minutes ago" and updates
Or a clock that uses the local system time and updates every second.
App.ApplicationController = Ember.Controller.extend({
time: function() {
return moment().format('h:m:s');
}.property('clock.second')
});
You can observe or display the following properties:
second
minute
five
quarter
hour
Each one is an incrementing integer.
During testing you may also set a custom interval time to speed up your tests.
For example use this.clock.set('intervalTime', 100);
to run the clock 10 times faster.
You may also reset the clock to 0 using this.clock.reset();
Copyright (c) 2014 Jerel Unruh and contributors
FAQs
The default blueprint for ember-cli addons.
The npm package ember-cli-clock receives a total of 186 weekly downloads. As such, ember-cli-clock popularity was classified as not popular.
We found that ember-cli-clock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.