HOME DOCS PWA ABOUT
  1. Replicator
    1. Write
    2. Read
    3. Upgrading the Container
  2. Concepts
    1. Storing Information
    2. Writing Specifications
    3. Retrieving Information
  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. Declare a Child Component
  4. Write Tests
    1. Write Some Tests (JavaScript)
    2. Write Some Tests (TypeScript)
    3. Create Related Facts
    4. Query Facts
    5. Export the Model (JavaScript)
    6. Export the Model (TypeScript)
    7. Authorize Facts
  5. Conventions
    1. JavaScript
    2. TypeScript
  6. Reference
    1. Jinaga
      1. fact
      2. query
      3. watch
      4. for
      5. match
      6. exists
      7. notExists
      8. not
      9. hash
      10. login
      11. local
      12. service
      13. onError
      14. onLoading
      15. onProgress
      16. graphviz
      17. inspect
    2. Preposition
      1. then
    3. Syntax diagram
  7. 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