Skip to content

New feature: Implement a way to associate a constant through a "useFlag()" or "useFeatureFlag()" #58

@gleissonneves

Description

@gleissonneves

I see that, just as the use of the Flag tag is an indirect means of associating the featureFlag constant with the rendering scenario, it would be important to make a context use available for variable usage scenarios.

// not implemented featureFlag
<Dropdown
        options={[
          { label: "Update", onClick: () => console.log("Update: " + id), disable: true },
          { label: "Delete", onClick: () => console.log("Delete: " + id), disable: true },
        ]}
/>
// implemented featureFlag
const useFeatureFlagCanUpdate = useFeatureFlag('update');
const useFeatureFlagCanDelete = useFeatureFlag('delete');

<Dropdown
        options={[
          { label: "Update", onClick: () => console.log("Editar: " + id), disable: useFeatureFlagCanUpdate  },
          { label: "Delete", onClick: () => console.log("Excluir: " + id), disable: useFeatureFlagCanDelete },
        ]}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions