fix: Change the source + add input

This commit is contained in:
J M
2022-05-17 17:25:25 -06:00
committed by Keagan McClelland
parent 52de5426ad
commit c8fc9a98bf
3 changed files with 7 additions and 2 deletions

View File

@@ -635,6 +635,11 @@ mod js_runtime {
Ok(ctx.input.clone())
}
#[op]
fn get_input(state: &mut OpState) -> Result<Value, AnyError> {
let ctx = state.borrow::<JsContext>();
Ok(ctx.input.clone())
}
#[op]
fn set_value(state: &mut OpState, value: Value) -> Result<(), AnyError> {
let mut answer = state.borrow::<AnswerState>().0.lock();
*answer = value;