![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@nebulare/data
Advanced tools
通过@nebulare/data
来实现,目前支持状态共享store
和事件监听响应event
两种方式
yarn add @nebulare/data
or
npm install @nebulare/data --save
get(key)
从store中根据(key: string | symbol)
获取变量值set(key,value)
根据(key: string | symbol | object)
设置store中的变量值has(key)
检查插件该变量是否有变量监听事件on(key,callback,force)
注册变量监听事件,(force: boolean)
,为true时,在注册过程中会执行一次callbackoff(key,callback)
删除已注册的变量监听事件clean(Array<key>)
删除变量的值和删除变量监听事件获取/修改 当前用户信息
// 主应用
import { store } from '@nebulare/data';
const userInfo = { name: '蒜香骨发烧友', age: 18 };
store.set('user', userInfo); // 登录后设置当前用户信息
// 子应用
import { store } from '@nebulare/data';
function showUser(userInfo) {
console.log('current user', userInfo);
}
// 获取当前用户信息
store.get('user');
// 监听当前用户信息变化
store.on('user', showUser, true);
// 是否有变量监听事件
store.has('user') // true
// 删除监听当前用户信息变化
store.off('user', showUser, true);
// 删除变量的值和删除变量监听事件
store.clean(['user']);
on(key,callback)
注册回调函数off(key,callback)
删除回调函数emit(key,...args)
触发已注册的回调函数,支持传参主应用有刷新当前列表入口,子应用内有执行函数,执行完函数后需要通知主应用刷新当前列表
在主应用监听事件
// 主应用
import { event } from '@nebulare/data';
event.on('refreshList', () => {
// 刷新当前列表
});
在子应用触发事件
// 子应用
import { event } from '@nebulare/data';
event.emit('refreshList');
FAQs
@nebulare/data is a javascript library for proxima communication
We found that @nebulare/data 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.