-
Notifications
You must be signed in to change notification settings - Fork 1
convert to dynamic config; return boolean, numeric and string responses (FF-860) #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5b5950a
to
c42ac0d
Compare
037493d
to
da53c90
Compare
da53c90
to
c63dde5
Compare
assignmentHooks?.onPostAssignment(experimentKey, subjectKey, assignment); | ||
|
||
if (assignment !== null) | ||
this.logAssignment(experimentKey, assignment, subjectKey, subjectAttributes); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the pre and post assignment events caused a bunch of duplicate code in these handlers
"target": "es2017", | ||
"outDir": "dist", | ||
"noImplicitAny": true, | ||
"strictNullChecks": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@leoromanovsky Can we test it with the updated test data from the GitHub Repository? |
Thanks Agam for the suggestion to add the new test cases the latest ones brought up a bug that I corrected. I also had a hard time getting the new
👉 Last bit of "clean up" I'd like to do here is try to unify the https://medium.com/@aems/one-mans-struggle-with-typescript-class-serialization-478d4bbb5826 |
gsutil cp gs://sdk-test-data/rac-experiments-v3.json $(testDataDir) | ||
gsutil cp -r gs://sdk-test-data/assignment-v2 $(testDataDir) | ||
mkdir -p $(tempDir) | ||
git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
if (ba === null) return null; | ||
return EppoValue.Bool(ba); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor but with short-circuiting and I think we could simplify this to return ba && EppoValue.Bool(ba)
.
> v = null
null
> v && Bool(v)
null
> v = true
true
> v && Boolean(v)
true
@@ -0,0 +1,28 @@ | |||
import { EppoValue } from './eppo_value'; | |||
|
|||
describe('EppoValue toString function', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
Fixes: #issue
Motivation and Context
Adds support for typed response functions.
Description
getAssignment(...): string
getStringAssignment
,getBoolAssignment
,getNumericAssignment
,getJSONAssignment
EppoValue
classHow has this been tested?
unit tests