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-command
Advanced tools
Implementation of the Command design pattern from C-Q-S for ember.
(fn)
and enjoy partial applications (because it stayed a
function)What you'll get:
Command
class to extend from for your implementationLinkCommand
as syntactic sugar for creating a link (through ember-link
)@command
decorator to connect your component with your command<CommandElement>
component as your building block to attach your command to the UI<CommandElement>
will accept a Command
, an @action
or a (link)
<CommandElement>
will render the correct HTML element to take care of
accessibilityInstall ember-command
with:
ember install ember-command
The idea for ember-command
is clearly to separate your business logic from
your UI by offering a couple of
mechanics to do that.
Write an action that invokes a service within a single file component.
import { action } from 'ember-command';
import { on } from '@ember/modifier';
const inc = action(({ services }) => () => {
services.counter.inc();
});
const Counter = <template>
<button type="button" {{(inc)}}>+</button>
</template>
export default Counter;
Compose various commands together to form a primitive that can be passed around.
This works well in combination with
ember-link
.
Let's make a link and add tracking to it:
import { command, action, CommandElement } from 'ember-command';
import { link } from 'ember-link';
const track = action(({ services }) => (event: string) => {
services.tracking.track(event);
});
const HomeLink = <template>
<CommandElement @command={{command
(fn (track) "go home")
(link "application")
}}>Home</CommandElement>
</template>
export default HomeLink;
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Commands for Ember
The npm package ember-command receives a total of 237 weekly downloads. As such, ember-command popularity was classified as not popular.
We found that ember-command demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.