
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
ember-computed-decorators
Advanced tools
This addon allows usage of the proposed decorator syntax, and passes the specified dependent keys into your computed function making your computed properties much DRY'er.
More details:
To use ember-computed-decorators you must update Babel's configuration to allow usage of the decorator proposal.
As of Babel 5.1.0 the following should be all you need in your ember-cli application:
// Brocfile.js
var app = new EmberApp({
babel: {
optional: ['es7.decorators']
}
});
// ember-cli-build.js
var app = new EmberApp({
babel: {
optional: ['es7.decorators']
}
});
In your application where you would normally have:
foo: Ember.computed('someKey', 'otherKey', function() {
var someKey = this.get('someKey');
var otherKey = this.get('otherKey');
// Do Stuff
})
You replace with this:
import computed from 'ember-computed-decorators';
// ..... <snip> .....
@computed('someKey', 'otherKey')
foo(someKey, otherKey) {
// Do Stuff
}
foo: Ember.computed(function() {
// Do Stuff
})
You replace with this:
import computed from 'ember-computed-decorators';
// ..... <snip> .....
@computed
foo() {
// Do Stuff
}
import Ember from 'ember';
import computed from 'ember-computed-decorators';
export default Ember.Component.extend({
@computed('first', 'last')
name(first, last) {
return `${first} ${last}`;
}
});
import Ember from 'ember';
import computed from 'ember-computed-decorators';
export default Ember.Component.extend({
@computed('first', 'last')
name: {
get(first, last) {
return `${first} ${last}`;
},
set(value, first, last) {
// ...
}
});
import Ember from 'ember';
import computed, { readOnly } from 'ember-computed-decorators';
export default Ember.Component.extend({
@readOnly
@computed('first', 'last')
name(first, last) {
return `${first} ${last}`;
}
});
When a computed property key contains @each
, []
(enumerable) then the
argument that is passed to the get
or set
method will be the object at the
path up to the @each
or []
part.
import Ember from 'ember';
import computed from 'ember-computed-decorators';
export default Ember.Component.extend({
persons: [
{ first: 'David', last: 'Heinemeier Hansson' },
{ first: 'Aaron', last: 'Patterson' }
]
@computed('persons.@each.{first,last}')
names(persons) {
return persons.map((person) => `${person.first} ${person.last}`);
}
});
When a computed property key contains {foo,bar}
then the arguments that are
passed to the get
or set
method will bet the expanded properties.
import Ember from 'ember';
import computed from 'ember-computed-decorators';
export default Ember.Component.extend({
address: {
street: 'Pennsylvania Avenue',
number: 1600
]
@computed('address.{street,number}')
formattedStreet(street, number) {
return `${number} ${street}`;
}
});
import DS from 'ember-data';
import {
attr,
hasMany
} from "ember-computed-decorators/ember-data";
export default DS.Model.extend({
@attr firstName,
@hasMany users
});
git clone
this repositorynpm install
bower install
ember server
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.
FAQs
The default blueprint for ember-cli addons.
The npm package ember-computed-decorators receives a total of 174 weekly downloads. As such, ember-computed-decorators popularity was classified as not popular.
We found that ember-computed-decorators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.