Skip to content

Instantly share code, notes, and snippets.

View Mermaid test
graph LR
Flag[Flag issue]
Block[Move to blocked]
S1>You found a bug]
S2>You found an improvement] --> C4
S1 --> C1{Prevents normal use?}
C1 --> |Yes| Flag
C1 --> |No| C2{Cause data corruption?}
View gist:e96cbd5cae3ff2266baa47d49796c4f2
let $i := 'Hello World!'
return concat($i, ' ', fn:current-date())
@wvbe
wvbe / ExampleMetadataTextInput.jsx
Last active May 24, 2019
A React hook for Fonto applications that makes it easy to build a (metadata) form for an XML subtree
View ExampleMetadataTextInput.jsx
/**
* This is an example of how the `useXQueryDataBinding` hook can be implemented for a simple form field (in this case the
* FDS `TextInput` component.
* The readQuery argument to `useXQueryDataBinding` returns a format (string) that is useful for the TextInput. I
* another case you might choose to return an XPath `map` or `array` instead and distribute that over multiple or more
* complex form components.
*
* The writeQuery argument is given the `$data('value')` XPath variable, which is whatever `TextInput` returns in its
* `onChange` callback - for this component, that is also a string.