Questions tagged [tcomb]

tcomb is a library for node.js and the browser which allows you to check the types of JavaScript values at runtime.

tcomb is a library for Node.js and the browser which allows you to check the types of JavaScript values at runtime with a simple and concise syntax. It's great for Domain Driven Design and for adding safety to your internal code.

23 questions
0
votes
1 answer

How to add a value to an inputText in tcomb-form-native?

I'am new in react native , and i'am using tcomb-form library to create forms for my app. I want to add a default values to some of my fields, means when they first appear they must have values by default. This is what i tried so far but the field…
Hamdi Gatri
  • 101
  • 2
  • 12
0
votes
2 answers

How to type a label on a tcomb form on React Native?

I have this code and I want to choose the label of each section, because they are automatically generated with the code. If i choose the "WineName" to "Wine Name" nothing happens. var type = t.enums({ type1: 'Red', type2: 'Rosé', type3:…
0
votes
1 answer

React-Native - Dynamically generating a form with tcomb-form using an Array of objects

I'm creating a tcomb-form through an array of objects but I don't have a lot of experience with it and honestly I'm struggling a little bit to get hang of it. This is the array structure that we are going to use: export const AUDIT_CONTENT = [ …
Pedro Martins
  • 219
  • 1
  • 10
0
votes
1 answer

tcomb - validation error message custom formatting

Currently I have a t.Number field. When I call t.validate() on it, it gives me the following result.errors: { "actual": "James King", "message": "Invalid value \"James King\" supplied to /user_id: Number", "path": ["user_id"] } Is it…
edster
  • 116
  • 2
  • 10
0
votes
1 answer

Importing tcomb lib in Angular 2 / webpack app gives undefined

Importing tcomb gives undefined: import t from 'tcomb'; console.log(t); // undefined // So this won't work t.assert(t.Number.is(colorString), 'colorString is invalid argument'); However I got it working like this, which actually I like…
Adrian Moisa
  • 3,923
  • 7
  • 41
  • 66
0
votes
2 answers

tcomb-form.js styling issues

I am using the tcomb-form for reactjs and I am having issues trying to change the styling of my image below: The text fields are extremely large and I want to make it smaller, so I created an arbitrary class called abcStyle, but I am not noticing…
ML.
  • 589
  • 1
  • 9
  • 33
0
votes
1 answer

Using tcomb, am I missing something or is it not possible to define an instance function?

I am trying to use tcomb and failing at the moment because I cannot wrap my head around how to define an instance function. Say I have a type: t.struct({ year: t.Integer, monthIndex: t.Integer, dayIndex: t.maybe(t.Integer), indexInMonth:…
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
0
votes
0 answers

Immutability vs manual checking performance

In a react native app using redux, I would like to update the state of the app with immutable-js. I'm using mergeDeep to update the state. There is one problem: when there has been removed an element from an array. So I'm detecting this case by…
Miquel
  • 8,339
  • 11
  • 59
  • 82
1
2