Skip to content

Use schema functor to generate custom schemas #2

@kettanaito

Description

@kettanaito

Reach Schema should come with a sensible default behavior. However, ceratin use cases may want to modify how a schema is applied. Examples of such modifications may be:

  • Custom resolver function arguments
  • Custom actual data traversal method

Specification

import { createSchemaFunctor } from 'reach-schema'

const applyCustomSchema = createSchemaFunctor({
  traverse: (tree, node) => {},
  resolver: (value) => {}
})

applyCustomSchema({
  data: ({ value }) => value !== 2
}, {
  data: 'value'
})

Call signatures to be designed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions