Skip to content
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

Dynamic Handling for Empirica.On #372

Open
2 tasks done
Jeffotter opened this issue Jul 27, 2023 · 0 comments
Open
2 tasks done

Dynamic Handling for Empirica.On #372

Jeffotter opened this issue Jul 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Jeffotter
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

Not really...More of an inefficiency. The issue is that one of my experimental variables is very dynamic in nature:

For example, each key I am passing could be a different capital letter of the alphabet. The problem is that in order to handle the case, my AttributeName in Empirica.on(model, attributeName, callback) would need to account for every case. (E.g 26 different letters)

Describe the solution you'd like

Ideally, I would like an option to submit one of the following:

A case function to handle multiple possible matches
An array of strings as an acceptable attribute name where each one will be checked
A third functionality where if you instead pass a variable instead of a string to attributeName this catch whatever key is set in stage.

Describe alternatives you've considered

I tried putting a list into the attribute name

I tried doing a chain of OR statements

Teachability, Documentation, Adoption, Migration Strategy

The user would in the Client call:

Stage.set('Today is ${var}', date)

On the server side:
Emprica.on("stage', NonstringVar, (ctx,{stage,NonstringVar}) =>
{ if( NonstringVar.substring(0,8) === 'Today is')

{ 
      //do specific code
} 

});

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Jeffotter Jeffotter added the enhancement New feature or request label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant