【问题标题】:Feature Flag handling in aws / amplify?aws / amplify中的功能标志处理?
【发布时间】:2020-03-31 11:09:03
【问题描述】:

我对 aws amplify 很陌生,想知道是否有任何功能标志处理机制或远程控制变量?当然我可以发送任何消息,在设备上接收它们并做任何我喜欢的事情,但我确信一定有其他方式,比如在 Google Firbease Remote Config 中。但据我所知,aws/amplify 的工具可以看到,仅在 aws 中配置远程功能标志就会产生很多开销。

【问题讨论】:

标签: aws-amplify


【解决方案1】:

我会寻找一个简单的托管工具。 https://www.featureflow.com 对我们非常有用,而且集成起来非常简单。例如在反应https://www.npmjs.com/package/react-featureflow-client

import { useFeatureflow, useFeatures } from 'react-featureflow-client'

const App: React.FC<Props> = () => {

  const featureflow = useFeatureflow();
  const features = useFeatures();
  const feature = 'example-feature';

  return  <div>
    <h1>A very simple example</h1>
    <b>{feature}</b>
    { featureflow.evaluate(feature).isOn() && [
        <p key="1">I am on</p>,
    ]}
    { featureflow.evaluate(feature).isOff() && [
      <p key="1">I am off</p>,
      ]
    }
    {Object.keys(features).map(key => <div>{key} : {features[key]}</div>)}
  </div>
}

或纯js:https://github.com/featureflow/featureflow-javascript-sdk

var FF_JS_API_KEY = '<Your javascript api key goes here>';
//...
var featureflow = Featureflow.init(FF_JS_API_KEY);
if(featureflow.evaluate('my-feature-key').isOn()){
  // this feature code will be run because 'my-feature-key' is set to 'on'
}

【讨论】:

    猜你喜欢
    • 2020-11-18
    • 2021-10-29
    • 2022-07-30
    • 2021-11-16
    • 2019-09-13
    • 1970-01-01
    • 2018-09-12
    • 1970-01-01
    • 2021-11-14
    相关资源
    最近更新 更多