API Reference
Configuration File Winnetoujs package Constructos Mutables State Management Mutations Select Methods Winnetou Fx Router Translations Color Themes WBR Compiler
Docs Change Log Git Hub Pull Requests Guidelines Get in touch

State Management of WinnetouJs Application


∯ Purpose

Controls app updates using mutables.

∯ Dynamic constructos

Use mutables to refresh constructos content.

Syntax

{mutable: name(string)}

Example

mutables.js
  
  import {Winnetou} from 'winnetoujs';
  import {profileCard} from './constructos/profile.js';
  ...

  Winnetou.setMutable('nameMut','John')

  profileCard({
    name:{mutable: 'nameMut'},
    age:'24'
  }).create('#app');

  Winnetou.setMutable('nameMut','Anna');
  // now profileCard was updated to show Anna in name prop
  
  
          

Or use not persistent behavior.

mutables.js
    
    import {Winnetou} from 'winnetoujs';
    import {profileCard} from './constructos/profile.js';
    ...
  
    let nameMut = Winnetou.initMutable('John')
  
    profileCard({
      name:{mutable: nameMut},
      age:'24'
    }).create('#app');
  
    Winnetou.setMutable(nameMut, 'Anna', false);
    // now profileCard was updated to show Anna in name prop