<commit_before>flocks
======

A radically simpler alternative to Flux - opinionated React state and rendering management

![Language](http://img.shields.io/badge/Language-Javascript/JSX-000000.svg) &nbsp;
![Platform](http://img.shields.io/badge/Platform-Node-000000.svg) &nbsp;
![License](http://img.shields.io/badge/License-MIT-000055.svg) &nbsp;
![Status](http://img.shields.io/travis/StoneCypher/flocks.js.svg)

[![NPM Downloads](http://img.shields.io/npm/dm/flocks.js.svg)](https://npmjs.org/package/flocks.js)

![](https://nodei.co/npm/flocks.js.png?stars=true&downloads=true)

This is a replacement for flux, not an implementation of it.  As such, this library is unrelated to [flox](https://github.com/foss-haas/flox/).





WARNING
-------

This is pre-release software.  This is the right way forwards, but it's only just on the verge of ready, and bugs should be expected.  The base API is now stable, but will soon be extended.  Proper tutorial on the way very soon `:)`

***Please consider this a beta product.***



The hell is this?
-----------------

So [flux](http://facebook.github.io/flux/) is pretty cool.  But, I wanted something simpler, because I wanted to move faster.  So, I created flocks - a flux alternative.



What's the big deal
-------------------

There's basically no boilerplate, and updating is easy.

You know that whole thing in Flux where you have to create stores and dispatchers and constant files and decide how many of each there'll be and set up bindings and so on?

```javascript
var Target = document.getElementById('whatever'),
    Update = Flocks.create({ target: Target, control: YourControl });

Update({ logged_in: true, user_name: "<NAME>", icon: "http://..." });
```

Done.

If you want that from inside the control, or even inside the heirarchy, that's fine; props, state, and contexts will cascade down safely and normally.

Now, you just write your app as a single control, and keep state 100% *outside* of the control heirarchy.  `:)`





More clearly?
-------------

What Flocks actually does is to provide you with an update function.

To get started, tell Flocks where the mount point is and what control to use.  Then, Flocks will create that control in place, and provide you an update function.  What you do with that function is up to you, though it's recommended that you pass it downwards, for use by your control and its children (and a mixin is provided to automate that, if you like.)

Then, Flocks will update the top-level control when the state it manages changes, by applying each key to a prop in the top-level.

The idea is that you're supposed to let Flocks manage the part of your application's state that gets visibly rendered.  (You can let it manage the whole state, if you want to; I do.  But you don't have to.)

Once that's done, the whole shebang is just taken off your shoulders.  No update calls.  No dispatching.  No events.  No broadcasting.  No registration or deregistration.

Just simple prop updates.  It's quite liberating.





Example plox
------------

One example is [flocks-mini-todo](https://www.npmjs.org/package/flocks-mini-todo) ([github](https://github.com/StoneCypher/flocks-mini-todo)).  More are coming soon.



Endnotes
--------

Are you using my lib?  Please let me know.  I'm curious!

If you want to reach me, try `stonecypher at gmail dot com`, please.  Thanks `:)`



Polemic :neckbeard:
-------------------

`flocks` is MIT licensed, because viral licenses and newspeak language modification are evil.  Free is ***only*** free when it's free for everyone.
<commit_msg>Remove non-collide notice<commit_after>flocks
======

A radically simpler alternative to Flux - opinionated React state and rendering management

![Language](http://img.shields.io/badge/Language-Javascript/JSX-000000.svg) &nbsp;
![Platform](http://img.shields.io/badge/Platform-Node-000000.svg) &nbsp;
![License](http://img.shields.io/badge/License-MIT-000055.svg) &nbsp;
![Status](http://img.shields.io/travis/StoneCypher/flocks.js.svg)

[![NPM Downloads](http://img.shields.io/npm/dm/flocks.js.svg)](https://npmjs.org/package/flocks.js)

![](https://nodei.co/npm/flocks.js.png?stars=true&downloads=true)





WARNING
-------

This is pre-release software.  This is the right way forwards, but it's only just on the verge of ready, and bugs should be expected.  The base API is now stable, but will soon be extended.  Proper tutorial on the way very soon `:)`

***Please consider this a beta product.***



The hell is this?
-----------------

So [flux](http://facebook.github.io/flux/) is pretty cool.  But, I wanted something simpler, because I wanted to move faster.  So, I created flocks - a flux alternative.



What's the big deal
-------------------

There's basically no boilerplate, and updating is easy.

You know that whole thing in Flux where you have to create stores and dispatchers and constant files and decide how many of each there'll be and set up bindings and so on?

```javascript
var Target = document.getElementById('whatever'),
    Update = Flocks.create({ target: Target, control: YourControl });

Update({ logged_in: true, user_name: "<NAME>", icon: "http://..." });
```

Done.

If you want that from inside the control, or even inside the heirarchy, that's fine; props, state, and contexts will cascade down safely and normally.

Now, you just write your app as a single control, and keep state 100% *outside* of the control heirarchy.  `:)`





More clearly?
-------------

What Flocks actually does is to provide you with an update function.

To get started, tell Flocks where the mount point is and what control to use.  Then, Flocks will create that control in place, and provide you an update function.  What you do with that function is up to you, though it's recommended that you pass it downwards, for use by your control and its children (and a mixin is provided to automate that, if you like.)

Then, Flocks will update the top-level control when the state it manages changes, by applying each key to a prop in the top-level.

The idea is that you're supposed to let Flocks manage the part of your application's state that gets visibly rendered.  (You can let it manage the whole state, if you want to; I do.  But you don't have to.)

Once that's done, the whole shebang is just taken off your shoulders.  No update calls.  No dispatching.  No events.  No broadcasting.  No registration or deregistration.

Just simple prop updates.  It's quite liberating.





Example plox
------------

One example is [flocks-mini-todo](https://www.npmjs.org/package/flocks-mini-todo) ([github](https://github.com/StoneCypher/flocks-mini-todo)).  More are coming soon.



Endnotes
--------

Are you using my lib?  Please let me know.  I'm curious!

If you want to reach me, try `stonecypher at gmail dot com`, please.  Thanks `:)`



Polemic :neckbeard:
-------------------

`flocks` is MIT licensed, because viral licenses and newspeak language modification are evil.  Free is ***only*** free when it's free for everyone.

{'fraction_non_alphanumeric': 0.12192345995162897, 'fraction_numerical': 0.00597524541186513, 'mean_word_length': 3.541343669250646, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1389057', 'n_tokens_mistral': 2181, 'n_tokens_neox': 1965, 'n_words': 903}