adopted-ember-addons / adopted-ember-addons/ember-launch-darkly
Export getCurrentContext function from -sdk module
- Linguagem predominante
- JavaScript
- Estrelas
- 14
- Forks
- 23
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
The [`getCurrentContext` function](https://github.com/adopted-ember-addons/ember-launch-darkly/blob/master/addon/-sdk/context.js#L8) may be useful to users (instead of accessing explicitly `window.__LD__`) to access the user context.
A use case I've in mind is when you want to enrich the data you passed previously to `identify()` by doing another call to it. In this case, it's handy to get the current user context, instead of gathering again all the needed data.
Right now, you can import it by doing
```js
import { getCurrentContext } from 'ember-launch-darkly/-sdk/context';
```
I think it would be nice to export it from the `-sdk` [module index](https://github.com/adopted-ember-addons/ember-launch-darkly/blob/master/addon/index.js), so that's clear that the function is intended to be used from the outside, as `identify`, `variation`, etc.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.