Skip to content
soliton4 edited this page Dec 7, 2014 · 4 revisions

#savable - type modifier

Stability: 3 - Stable

requires

implies

the savable modifier automatically triggers the unique modifier. so savable types are also unique types.

provides an adapter to load and save instances.

the new operator of savable types results in a promise of the type. this is due to the fact that a asynchronous loading routine my be required to load the data.

  class type savable MyData {
    member1: "default",
    member2: "default"
  };
  
  MyData data = *new MyData("id1");

the id logic is inherited from the unique modifier.

.save()

a promising "save" member function is provided to trigger saving.

  data.member1 = "something";
  *data.save(); // save and wait for save to finish
Clone this wiki locally