Skip to content

how to define a model with arbitrary properties #1783

Answered by dodoto
dodoto asked this question in Q&A
Discussion options

You must be logged in to vote
const TestModel = types.refinement(
  types.map(types.string),
  (value) => Object.keys(value).every((key) =>
    typeof key === "string" && typeof value[key] === "string"
  })
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fernandomg
Comment options

Answer selected by dodoto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants