
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
参考vuex为小程序增加状态管理并提供页面间通信接口
// app.js
import Store from 'wx-store';
const store = new Store({
state: {
counter: 0,
},
mutations: {
count(state, payload) {
return state.counter += payload;
},
},
actions: {
countAsync(store, payload) {
return new Promise(resolve => {
setTimeout(() => {
store.commit('count', payload);
resolve();
}, 2000);
});
},
}
});
App({
store,
// 简化postMessage调用
postMessage: store.postMessage.bind(store)
});
// page1
<view>{{$state.counter}}</view>
const app = getApp();
Page({
onLoad() {
console.log(this.data.$state.counter);
app.store.commit('count', 1);
app.store.dispatch('countAsync', 1).then(() => {
app.store.setState({
counter: 955
});
});
app.postMessage('page2', {
type: 'msg',
data: 'message from page1'
});
}
});
// page2
<view>{{$state.counter}}</view>
Page({
onLoad() {
console.log(this.data.$state.counter);
},
onMessage(data) {
console.log(data);
}
});
FAQs
参考vuex为小程序增加状态管理并提供页面间通信接口
We found that wx-store 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.