"use strict";
var immutable_1 = require("immutable");
var index_1 = require("../index");
var Book;
(function (Book) {
    Book.title = index_1.property("TITLE", function (book) { return book.title; });
    Book.setTitle = index_1.action("SET_TITLE", function (book, title) { return index_1.amend(book, { title: title }); });
    Book.setPrice = index_1.action("SET_PRICE", function (book, price) { return index_1.amend(book, { price: price }); });
    Book.addAuthor = index_1.action("ADD_AUTHOR", function (book, author) { return index_1.amend(book, { authors: book.authors.push(author) }); });
    Book.empty = {
        title: "",
        price: 0,
        authors: immutable_1.List()
    };
    Book.reduce = index_1.reducer(Book.empty)
        .action(Book.title)
        .action(Book.setTitle)
        .action(Book.setPrice)
        .action(Book.addAuthor);
})(Book = exports.Book || (exports.Book = {}));
//# sourceMappingURL=book.js.map