npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kuaishou-frontend-ad-dobux-vue

v1.0.0

Published

- 运行时小能手。提供数据管理和常见API的通用能力 ## 目标 - 目标一: 响应式数据管理、自动化model响应、尽可能的把逻辑集中在model层 - 目标二: 对于常见的hook函数。不希望每次新建项目都copy一份。在此包中提供通用纯函数.

Downloads

57

Readme

sdk定位

  • 运行时小能手。提供数据管理和常见API的通用能力

目标

  • 目标一: 响应式数据管理、自动化model响应、尽可能的把逻辑集中在model层
  • 目标二: 对于常见的hook函数。不希望每次新建项目都copy一份。在此包中提供通用纯函数.

TODO

  • 支持getters(主要是state会被reactive丢失computed)以及mapGetters方法 p1 done
  • makeAjax支持插槽函数(尽可能简单的支持,如写一个Array.reduce) p2
  • router集成到数据管理里面(先不考虑route) p3
  • polly 支持轮询请求。(插槽式支持) p2
  • eventBus 以eventBus作全局model。输出与createProvider相同 p1
  • makeEffect支持传参数。 p1 done
  • reducer支持reset里面传参数。 p1 done
  • reducer的compose改为用key实现,而不是直接覆盖 p1 done
  • 把composeState、reset等暴露出来 p1 edwardnie
  • reset改成真实的reset(识别state下的每个reactive) p1 done
  • 待考虑是否仅reducer可以变更数据。保护数据的不可变 p3
  • loading的请求不能重复发送、loading的请求支持配置成取消上一个请求,只调最新的请求 p1
  • 使用原生fetch取代axios p3
  • 不断的补充hook能力进来 p1
  • 表层的protect,禁止赋值为object,只能reducers驱动 P1
  • 通过高节函数来生成用model,添加model的destroy生命周期 p1
  • jest单元测试 p2
  • v-loading的指令导出 p1
  • 请求添加immediate参数 p1 done
  • 工程改成monorepo p1

model的使用

  • reducers 内置compose、reset等方法
  • effects的函数自带loading和error属性,无需业务逻辑处理
  • 尽可能在model层写watch\computed等保证model与UI绝对分离
  • model之间可以互相引用。import {useContext}后直接使用即可
  • createContext在高级组件处使用。useContext在低级组件处使用。model生命周期与createContext生命周期一致。createContext和useContext返回是一致的
  • makeEffect负责添加loading和message属性。makeAjax负责自动发请求

hook的todo

  • useResetData 支持reset功能
  • useWindowSize
  • useWindowScroll
  • pauseable watch

开发方式

yarn cd apps/project yarn link cd ../../ yarn link dobux-vue2 yarn serve

其中:如果报错的话:排查yarn link问题 ~/.config/yarn/link 保存本地link信息

docs开发方式

vuepress dev docs vuepress build docs

docs部署 sh deploy-test.sh

发布npm包

npm run build !!!!!!!! 忘了好几次了,重要 npm login --registry=https://registry.npmjs.org 外网发布 账号edwardnie npm publish --registry=https://registry.npmjs.org

npm publish 内网发布