Skip to content

Nucleo Types

Matheus Marsiglio edited this page Aug 28, 2018 · 4 revisions

Nucleo is a strongly typed state container which manages contracts to every data you dispatch to be saved in store.

Nucleo Types are primarily thought to attend the language type system it's built. In JavaScript, we have the primitive types, object types, list types and function types.

Object types

The only object type for Nucleo is its NucleoObjectType.

Lists (non-implemented)

NucleoList: used to be an instance of NucleoList of primitive types or NucleoObjectTypes;

Usage:

import { 
NucleoList,
NucleoObjectType,
NucleoString
} from 'nucleo';

const example = new NucleoObjectType({
  name: 'example',
  fields: {
    exampleField: new NucleoList(NucleoString)
  }
});

Primitive Types

  • NucleoString:
  • NucleoNumber:
  • NucleoBoolean: