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

ia-factory-sdk

v0.0.21

Published

ia-factory JS SDK

Downloads

10

Readme

ia-factory-sdk

互动工厂SDK集合

安装

npm install --save ia-factory-sdk

sdk.factory.request 使用

import sdk from 'ia-factory-sdk';

sdk.request.config({
    whiteInterfaceArr: []
});
// eg: 调用互动工厂接口
sdk.factory.request.createActivityTemplate()
sdk.factory.request 下的接口说明

| 接口名 | 接口描述 | 接口详细说明 | | ---- | ---- | ---- | | createActivityTemplate | 创建互动模板 | 链接 | | delActivityTemplate | 删除互动模板 | 链接 | | updateActivityTemplate | 修改互动模板| 链接 | | getActivityTemplate | 查询互动模板详情| 链接 | | getActivityTemplateList | 查询互动模板列表| 链接 | | createActivity | 创建活动| 链接 | | delActivity | 删除活动| 链接 | | updateActivity | 修改活动| 链接 | | getActivity | 查询活动详情| 链接 | | getActivityList| 查询活动列表| 链接 | | createRecord | 创建参与记录| 链接 | | delRecord | 删除参与记录| 链接 | | updateRecord | 修改参与记录| 链接 | | getRecord | 查询活动参与记录详情| 链接 | | getRecordList | 查询活动参与记录列表| 链接|

sdk.modelInterceptor 说明

用于在设计业务组件模型时,将业务组件的声明周期通过装饰器高阶函数暴露,进行统一操作。

import sdk from "ia-factory-sdk";
const { modelInterceptor } = sdk;

@modelInterceptor({
  name: "sign",
})
class Sign extends Taro.Component {

}
export default Sign;
sdk.event 说明

场景1:在设计业务模型组件时,引用了@modelInterceptor, 那么在调用方可以在Taro page的componentWillMount 里统一进行生命周期的注册。

import sdk from "ia-factory-sdk";
const { event } = sdk;

const enumEvent = {
    afterDidMount: "sign.after.componentDidMount"
};

event.on(enumEvent.afterDidMount, (data) => {
    console.log("触发事件", data);   
});

场景2:事件中心

import sdk from "ia-factory-sdk";
const { event } = sdk;

event.emit('click', {
    value: {
        props: this.props,
        state: this.state
    }
});

event.on('click, (data) => {
    data.callback(true);
    console.log("触发事件", data);
});