<commit_before>import { run } from "meiosis";

import { component } from "./component";

import { component as counter } from "../counter";
import { component as button } from "../button";
import { component as randomGif } from "../random-gif";
import { component as randomGifPair } from "../random-gif-pair";
import { component as randomGifPairPair } from "../random-gif-pair-pair";
import { component as randomGifList } from "../random-gif-list";

export function startApp() {
  const receive = (model, proposal) => {
    model = component.receive(model, proposal);
    model.button = button.receive(model.button, proposal);
    model.randomGif1 = randomGif.receive(model.randomGif1, proposal);
    model.randomGif2 = randomGif.receive(model.randomGif2, proposal);
    model.randomGifPair = randomGifPair.receive(model.randomGifPair, proposal);
    model.randomGifPairPair = randomGifPairPair.receive(model.randomGifPairPair, proposal);
    model.randomGifList = randomGifList.receive(model.randomGifList, proposal);
    return model;
  };

  const initial = {
    counter: counter.initialModel(),
    button: button.initialModel(),
    randomGif1: randomGif.initialModel(),
    randomGif2: randomGif.initialModel(),
    randomGifPair: randomGifPair.initialModel(),
    randomGifPairPair: randomGifPairPair.initialModel(),
    randomGifList: randomGifList.initialModel()
  };

  return run({ initial, scanner: { model: receive } });
}<commit_msg>Example with fixed id vs generated id.<commit_after>import { run } from "meiosis";

import { component } from "./component";

import { component as counter } from "../counter";
import { component as button } from "../button";
import { component as randomGif } from "../random-gif";
import { component as randomGifPair } from "../random-gif-pair";
import { component as randomGifPairPair } from "../random-gif-pair-pair";
import { component as randomGifList } from "../random-gif-list";

export function startApp() {
  const receive = (model, proposal) => {
    model = component.receive(model, proposal);
    model.button = button.receive(model.button, proposal);
    model.randomGif1 = randomGif.receive(model.randomGif1, proposal);
    model.randomGif2 = randomGif.receive(model.randomGif2, proposal);
    model.randomGifPair = randomGifPair.receive(model.randomGifPair, proposal);
    model.randomGifPairPair = randomGifPairPair.receive(model.randomGifPairPair, proposal);
    model.randomGifList = randomGifList.receive(model.randomGifList, proposal);
    return model;
  };

  const initial = {
    counter: counter.initialModel(),
    button: button.initialModel(),
    randomGif1: randomGif.initialModel("randomGif1"), // can either assign an id...
    randomGif2: randomGif.initialModel(),             // or use the component's generated id
    randomGifPair: randomGifPair.initialModel(),
    randomGifPairPair: randomGifPairPair.initialModel(),
    randomGifList: randomGifList.initialModel()
  };

  return run({ initial, scanner: { model: receive } });
}
{'fraction_non_alphanumeric': 0.12773722627737227, 'fraction_numerical': 0.0043132050431320505, 'mean_word_length': 4.403225806451613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5199393', 'n_tokens_mistral': 897, 'n_tokens_neox': 872, 'n_words': 209}