YCB ConfigYahoo 配置捆绑文件

联合创作 · 2023-09-28 15:18

YCB Config 提供了一个简单的 API 去访问和配置 Yahoo 配置捆绑文件,并可以无视文件使用格式。它也提供了一个缓存层来减少 YCB 模块对进程的调用。

示例代码:

// This contextual information is usually obtained from some custom middleware 
in your application.
var context = {    
'device': 'iphone',    
'locale': 'en-US',    
'bucket': 'new-feature-x'};
// This requires that the config we're reading has already been added through `addConfig`.
helper.read('homepage', 'weather-widget', context, function (err, config) {    
/**     
* The `config` object now contains the correct configuration settings for     
* our context above.  You can use it to render a template correctly for an    
* iPhone, with the right localization settings for the US, and with the new     
* feature you're bucket testing for.     
*/});
浏览 2
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报