<commit_before># meiosis-setup

[Meiosis](https://meiosis.js.org) is a pattern, not a library. Nevertheless, in response to popular
demand and for your convenience, here are some utility functions that help set up and use Meiosis.

## Getting Started

To use `meiosis-setup`, you specify a stream library, and, optionally, a library instance to manage
how patches are merged to the application state. Of course, you'll also need a view library.

### Choosing a stream library

Out of the box, `meiosis-setup` supports these stream libraries:

- the `simpleStream` provided by `meiosis-setup`
- [Flyd](https://github.com/paldepind/flyd)<commit_msg>Update meiosis-setup readme.<commit_after># meiosis-setup

[Meiosis](https://meiosis.js.org) is a pattern, not a library. Nevertheless, in response to popular
demand and for your convenience, here are some utility functions that help set up and use Meiosis.

`meiosis-setup` wires up the Meiosis pattern for you with these conveniences:

- wires up the `update` and `states` streams
- creates your `actions`
- provides the ability to call `update()` with an array of patches, automatically combining them into
  a single patch
- automatically ignores null patches
- calls your `service` and `effect` functions, passing in `state`, `previousState`, `patch`,
  `update`, and `actions`
- omits consecutive identical `states`, thus avoiding unncessary re-renders
- provides a simple stream implementation
- works with Flyd, Mithril-Stream, Mergerino, function patches, and Immer out of the box
- wires up React and Preact
- works with Mithril and lit-html.

## Getting Started

To use `meiosis-setup`, you specify a stream library, and, optionally, a library instance to manage
how patches are merged to the application state. Of course, you'll also need a view library.

### Choosing a stream library

Out of the box, `meiosis-setup` supports these stream libraries:

- the `simpleStream` provided by `meiosis-setup`
- [Flyd](https://github.com/paldepind/flyd)
{'fraction_non_alphanumeric': 0.08532934131736528, 'fraction_numerical': 0.0, 'mean_word_length': 4.712250712250713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '3675107', 'n_tokens_mistral': 569, 'n_tokens_neox': 537, 'n_words': 260}