Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
dojo-actions
Advanced tools
A command like library for Dojo 2 Applications.
WARNING This is alpha software. It is not yet production ready, so you should use at your own risk.
Actions embody the concept of doing something that can be express behaviour without having to re-implement the behaviour in various locations of an application. In the concept of a Dojo 2 application, Widgets call Actions which mutate state in Stores which change the State of Widgets.
To create a new action, simply use the Action factory:
import createAction from 'dojo-actions/createAction';
const action = createAction({
do() {
/* do something */
}
});
action
.do()
.then((result) => {
/* do something with the result */
});
You must specify a do()
method when using the Action factory. The Action will wrap the .do()
method, ensuring that no matter what the return, it will return a dojo-core/async/Task
which is a Promise
with the ability to cancel.
Each Action has a .state
object which contains any sort of mutatable state. This is provided by the dojo-compose/mixin/createStateful
mixin. When the .do()
method is invoked, it is scoped so that this
is the calling action, and therefore this.state
can be used to read from the state.
It is envisioned that some foundational "helper" actions will be added to this package to make it easy.
The easiest way to use this package is to install it via npm
:
$ npm install dojo-actions
In addition, you can clone this repository and use the Grunt build scripts to manage the package.
Using under TypeScript or ES6 modules, you would generally want to just import
the dojo-actions/createAction
module:
import createAction from 'dojo-compose/createAction';
const action = createAction({
do() { /* do something */ }
});
action.do();
We appreciate your interest! Please see the Dojo 2 Meta Repository for the Contributing Guidelines and Style Guide.
Test cases MUST be written using Intern using the Object test interface and Assert assertion interface.
90% branch coverage MUST be provided for all code submitted to this repository, as reported by istanbul’s combined coverage results for all supported platforms.
To test locally in node run:
grunt test
To test against browsers with a local selenium server run:
grunt test:local
To test against BrowserStack or Sauce Labs run:
grunt test:browserstack
or
grunt test:saucelabs
TODO: If third-party code was used to write this library, make a list of project names and licenses here
© 2004–2015 Dojo Foundation & contributors. New BSD license.
FAQs
A command library for Dojo 2 Applications
The npm package dojo-actions receives a total of 1 weekly downloads. As such, dojo-actions popularity was classified as not popular.
We found that dojo-actions 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.