Skip to content

Commit

Permalink
docs: document useCondition
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Nov 17, 2022
1 parent 27cd0bc commit 8d73786
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/form-js-viewer/src/render/hooks/useCondition.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import useService from './useService.js';

/**
* Check if condition is met with given variables.
*
* @param {{ expression?: string } | undefined} condition
* @param {string | undefined} condition
* @param {import('../../types').Data} data
*
* @returns {boolean} true if condition is met or no condition or condition checker exists
*/
export function useCondition(condition, data) {
const conditionChecker = useService('conditionChecker', false);
Expand Down

0 comments on commit 8d73786

Please sign in to comment.