
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
A distributed and reactive programming style, which allows you to write the core logic of the app, can run on every view framework.
reaxes的设计哲学是:应用的逻辑应该与其他模块解耦,特别是视图
和用户输入
$ npm i -S reaxes
https://kane-7.gitbook.io/reaxes-document
// reaxels/counter.ts
import { createReaxable , obsReaction } from 'reaxes';
export const reaxel_Counter = reaxel(() => {
//create a reactive store , so you can subscribe changes when you need.
const { store , setState , mutate } = createReaxable({
count : 0,
});
return Object.assign(() => {
return {
get count(){
return store.count;
} ,
setCount( count: number ){
setState({ count });
} ,
};
} , {
store ,
setState ,
mutate ,
});
});
// when count changed, refresh DOM
import { reaxel_Counter } from './reaxels/counter';
import { obsReaction } from 'reaxes';
function render(){
const { count , setCount } = reaxel_Counter();
const div = document.createElement('div');
div.onclick = () => setCount(count + 1);
div.innerText = count;
return div;
}
//listen store.count , once it changes,render() will be re-runed automatically
obsReaction(
( first , dispose ) => {
document.write(render());
if(first){
console.log('div element mounted');
}
} ,
//place all observable props here
() => [ reaxel_Counter().count ]
);
// there is no need to use obsReaction for every component
// because reaxper will do this automaticlly
// all you need is just to wrap you components with reaxper();
import { reaxper } from 'reaxes-react';
import { reaxel_Counter } from './reaxels/counter';
// functional component
export const Count = reaxper(() => {
const {count,setCount} = reaxel_Counter();
return <div onClick = { () => setCount(count+1) }>
count:{ count }
</div>;
});
// or use class component
import { Component } from 'react';
@reaxper
class CountComponent extends Component {
render(){
const {count,setCount} = reaxel_Counter();
return <div onClick = { () => setCount(count+1) }>
count:{ count }
</div>;
}
}
<template>
<div @click="setCount()">
{{ count }}
</div>
</template>
<script>
import { reaxel_Counter } from './reaxels/counter';
export default {
status(){
const {count} = reaxel_Counter();
return { count };
},
methods:{
setCount(){
const {count,setCount} = reaxel_Counter();
setCount(count+1);
}
}
}
</script>
pre {
tab-size: 3;
}
FAQs
A distributed and reactive programming style, which allows you to write the core logic of the app, can run on every view framework.
The npm package reaxes receives a total of 11 weekly downloads. As such, reaxes popularity was classified as not popular.
We found that reaxes demonstrated a healthy version release cadence and project activity because the last version was released less than 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 phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.