<commit_before># Rafman.js
Rafman.js helps you manage requestAnimationFrame work.

## Installation
Just include `rafman.js` in your page. There are no dependencies.

## Usage
Rafman.js registers a `Rafman` object in the global namespace.

### `Rafman.start()`
Starts the ticking. Every tick is requested using requestAnimationFrame. On ever tick your registered callbacks will be executed.

### `Rafman.pause()`
Stops the ticking.

### `Rafman.once([id, ]callback, [args, ...])`
Register a callback to be executed only on the next tick. This is particularly useful to throttle events.

	Rafman.once(function() {
		// do something
	});

An id can be specified which can later be used to cancel the callback.
	
	Rafman.once('someId', function() {
		// do something
	});

	Rafman.cancel('someId');

In case of an event handler you could do something like the following. Note that it's possible to pass the arguments you want the callback to be called with.

	var scrollCallback = function(event, anotherArg) {
		// do something
	}
	
	window.onscroll = function(event) {
		Rafman.once(scrollCallback, event, anotherArg);
	}

### `Rafman.always([id, ]callback)`
Register a callback to be called on every tick. Useful if you are constantly animating like in a game.

### `Rafman.cancel(id|callback)`
Cancel the execution of a callback. It's possible to pass the callback itself, or the id it was registered with. This function cancels callbacks registered with both `once` and `always`.

### `Rafman.clear()`
Clear all registered callbacks.

## To do
- Add tests because `test.html` is a mess. requestAnimationFrame is kinda hard to test. Any tips?

## License
Licensed under the MIT license.

Copyright (c) 2013 <NAME><commit_msg>Small update to the readme<commit_after># Rafman.js
Rafman.js helps you manage requestAnimationFrame work.

## Installation
Just include `rafman.js` in your page. There are no dependencies.

## Usage
Rafman.js registers a `Rafman` object in the global namespace.

### `Rafman.start()`
Start requesting frames using requestAnimationFrame until all the work is done.

### `Rafman.pause()`
Stop requesting frames.

### `Rafman.once([id, ]callback, [args, ...])`
Register a callback to be executed only on the next frame. This is particularly useful to throttle events.

	Rafman.once(function() {
		// do something
	});

An id can be specified which can later be used to cancel the callback.
	
	Rafman.once('someId', function() {
		// do something
	});

	Rafman.cancel('someId');

In case of an event handler you could do something like the following. Note that it's possible to pass the arguments you want the callback to be called with.

	var scrollCallback = function(event, anotherArg) {
		// do something
	}
	
	window.onscroll = function(event) {
		Rafman.once(scrollCallback, event, anotherArg);
	}

### `Rafman.always([id, ]callback)`
Register a callback to be called on every frame. Useful if you are constantly animating like in a game.

### `Rafman.cancel(id|callback)`
Cancel the execution of a callback. It's possible to pass the callback itself, or the id it was registered with. This function cancels callbacks registered with both `once` and `always`.

### `Rafman.clear()`
Clear all registered callbacks.

## To do
- Add tests because `test.html` is a mess. requestAnimationFrame is kinda hard to test. Any tips?

## License
Licensed under the MIT license.

Copyright (c) 2013 <NAME>
{'fraction_non_alphanumeric': 0.09824561403508772, 'fraction_numerical': 0.0023391812865497076, 'mean_word_length': 4.2469325153374236, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6356922', 'n_tokens_mistral': 1025, 'n_tokens_neox': 974, 'n_words': 434}