fix(examples): properly update memoized value in non-schema case (#6641)

This commit is contained in:
Tim Lai
2020-11-19 13:55:32 -08:00
committed by GitHub
parent 451da70f7e
commit d2ef8f31b9
2 changed files with 64 additions and 3 deletions

View File

@@ -332,14 +332,14 @@ export const inferSchema = (thing) => {
return thing // Hopefully this will have something schema like in it... `type` for example
}
export const createXMLExample = (schema, config={}, o) => {
export const createXMLExample = (schema, config, o) => {
const json = sampleFromSchemaGeneric(schema, config, o, true)
if (!json) { return }
return XML(json, { declaration: true, indent: "\t" })
}
export const sampleFromSchema = (schema, config={}, o) =>
export const sampleFromSchema = (schema, config, o) =>
sampleFromSchemaGeneric(schema, config, o, false)
export const memoizedCreateXMLExample = memoizee(createXMLExample)