You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should think about passing in some sort of context when a variable token is executed. This would allow functions to make decisions based on a previous templates outcome. I'm thinking along the lines of:
Splain.addEntry({colors:["red","green","blue"]});letgetCol=(context)=>{if(context.someWayToGetPreviousToken==="red")return"#ff0000";if(context.someWayToGetPreviousToken==="green")return"#00ff00";if(context.someWayToGetPreviousToken==="blue")return"#0000ff";return'#ffffff';};console.log(Splain.process("why not try {{colors}} ({{##getCol}})",{getCol}));
The text was updated successfully, but these errors were encountered:
We should think about passing in some sort of context when a variable token is executed. This would allow functions to make decisions based on a previous templates outcome. I'm thinking along the lines of:
The text was updated successfully, but these errors were encountered: