Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ember-redux
Advanced tools
Predictable state management for ember apps
ember redux requires ember-cli v2.4+ and node 6+
ember install ember-redux
Counter https://ember-twiddle.com/5bee7478e4216abe49f1c0a439bae352
TodoMVC https://ember-twiddle.com/4bb9c326a7e54c739b1f5a5023ccc805
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
import { connect } from 'ember-redux';
import getUsersByAccountId from '../reducers';
import fetch from 'fetch';
var stateToComputed = (state, attrs) => {
return {
users: getUsersByAccountId(state, attrs.accountId)
};
};
var dispatchToActions = (dispatch) => {
return {
remove: (id) => fetch(`/api/users/${id}`, {method: 'DELETE'}).then(fetched => fetched.json()).then(response => dispatch({type: 'REMOVE_USER', id: id}))
};
};
var UserListComponent = Ember.Component.extend({
layout: hbs`
{{yield users (action "remove")}}
`
});
export default connect(stateToComputed, dispatchToActions)(UserListComponent);
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
var UserTableComponent = Ember.Component.extend({
layout: hbs`
{{#each users as |user|}}
<div>{{user.name}}</div>
<button onclick={{action remove user.id}}>remove</button>
{{/each}}
`
});
export default UserTableComponent;
{{#user-list accountId=accountId as |users remove|}}
{{user-table users=users remove=remove}}
{{/user-list}}
Install the redux dev tools extension.
Enjoy!
yarn
ember test
Copyright © 2017 Toran Billups http://toranbillups.com
Licensed under the MIT License
FAQs
ember-cli addon that provides simple redux bindings for ember.js
The npm package ember-redux receives a total of 296 weekly downloads. As such, ember-redux popularity was classified as not popular.
We found that ember-redux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.