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-cli-fetch-async-button
Advanced tools
Button states, disabling, and promise handling for async actions. Built to support ember-fetch async calls.
This addon is based on the Dockyard ember-cli addon 'ember-cli-async-button'... https://github.com/dockyard/ember-async-button
Implemented with support for fetch. You can read more about fetch here. http://updates.html5rocks.com/2015/03/introduction-to-fetch
& the github polyfill which ember-fetch uses... https://github.com/github/fetch
This adds the initial 'then' handler, which validates the response status before either throwing that response as an error to the 'catch' handler, or returning onto the successful 'then' handler.
v0.2.0 adds support to validate hashes and arrays of promises. The component will initialize
the button's rejected
state if any of the promises in the array or hash cause a throw
.
To use fetch with your ember application, I recommend installing stefanpenner's ember-fetch. https://github.com/stefanpenner/ember-fetch
Basic Usage
{{fetch-async-button class="button"
asyncAction=(action "save")
default="Save"
pending="Saving..."
fulfilled="Saved!" }}
save(cb) {
const user = Ember.Object.create({
user: {
name: this.get('name')
}
});
const promise = fetch(`/api/v2/users/${this.get('model.id')}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Data-Type': 'json'
},
body: JSON.stringify(user),
credentials: 'include'
});
cb(promise);
promise
.then(response => {
if (response.status >= 200 && response.status < 300) {
return response;
} else {
throw response;
}
})
.then(() => {
console.log('Successfully updated User');
})
.catch(err => {
console.log('Error updating user', err);
});
},
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
Button states, disabling, and promise handling for async actions. Built to support ember-fetch async calls.
We found that ember-cli-fetch-async-button 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.
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.