Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 807 Bytes

7-standalone-usage.md

File metadata and controls

28 lines (20 loc) · 807 Bytes

Standalone usage

This section discusses how Remerge can be used as a standalone script.

Remerge is also distributed as a standalone script, which exposes a global merge function.

Remerge's built-in reducers are distributed in another script, which exposes a global reducers object whose properties are the reducers.

These scripts can be found in the dist folder.

Usage of the script is mostly the same, except that the reducers are namespaced under reducers:

<script src="merge.js"></script>
<script src="reducers.js"></script>

<script>
  var reducer = merge({
    todos: {
      _: [],
      add: reducers.arrayInsertReducer,
      delete: reducers.arrayDeleteReducer
    }
  })
</script>

A full example can be found in examples/standalone.