HOME DOCS PWA ABOUT
  1. Replicator
    1. Write
    2. Read
    3. Authorization
    4. Distribution
    5. Upgrading the Container
  2. Concepts
    1. Storing Information
    2. Writing Specifications
    3. Projecting Results
  3. Create an App
    1. Create React App
    2. Install Jinaga
    3. Define a Model
    4. Initialize a Starting Point
    5. Declare a Component
    6. Match Successor Facts
    7. Select a Sub-Specification
    8. Filter Out Prior Versions
  4. Conventions
    1. JavaScript
    2. TypeScript
  5. Reference
    1. JinagaBrowser.create
    2. buildModel
    3. j.login
    4. j.fact
    5. given.match
    6. j.query
    7. j.watch
    8. j.hash
    9. AuthorizationRules
    10. JinagaTest.create
  6. Jinaga React
    1. Composition
    2. Field Specification Functions
      1. field
      2. projection
      3. collection
      4. property
      5. mutable
      6. array
  1. Jinaga React
  2. Field Specification Functions

field

The simplest field specification function provides an immutable value based on the fact. Use it to copy a field directly from the fact into state.

{
    text: field(m => m.text)
}

Or to compute the hash.

{
    hash: field(m => j.hash(m))
}

Or to store the fact itself.

{
    fact: field(m => m)
}

Continue With

projection