Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
reactive-di
Advanced tools
Dependency injection with reactivity, state-management, state-to-css, state-to-dom rendering.
npm install --save reactive-di lom_atom
Example .babelrc:
{
"presets": [
"flow",
"react",
["es2015", {"loose": true}]
],
"plugins": [
"transform-decorators-legacy",
["transform-react-jsx", {"pragma": "lom_h"}]
]
}
Build rdi and copy to ../app-project/node_modules/reactive-di
npm run watch --reactive-di:dest=../app-project
In:
// @flow
import {mem} from 'lom_atom'
import {createReactWrapper, createCreateElement, Injector} from 'reactive-di'
import {render, h, Component} from 'preact'
function ErrorableView({error}: {error: Error}) {
return <div>
{error instanceof mem.Wait
? <div>
Loading...
</div>
: <div>
<h3>Fatal error !</h3>
<div>{error.message}</div>
<pre>
{error.stack.toString()}
</pre>
</div>
}
</div>
}
const lomCreateElement = createCreateElement(
createReactWrapper(
Component,
ErrorableView
),
h
)
global['lom_h'] = lomCreateElement
class HelloContext {
@mem name = ''
}
function HelloView(
{prefix}: {prefix: string},
{context}: {context: HelloContext}
) {
return <div>
{prefix}, {context.name}
<br/><input value={context.name} onInput={
(e: Event) => {
context.name = (e.target: any).value
}
} />
</div>
}
HelloView.deps = [{context: HelloContext}]
render(<HelloView prefix="Hello" />, document.body)
4.0.5 (2017-08-14)
<a name="4.0.4"></a>
FAQs
Reactive dependency injection
The npm package reactive-di receives a total of 14 weekly downloads. As such, reactive-di popularity was classified as not popular.
We found that reactive-di 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.
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.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.