Skip to content

Item data models #12

@ildar-ceo

Description

@ildar-ceo

Идея в том, чтобы можно было добавлять дополнительные методы для работы с моделями фронтенда. Например:

class Product extends MapModel
{
	
	/**
	 * Получить цену
	 */
	double getPrice() => this.get("price") |> default int 0;
	
}

class Basket<Product> extends VectorModel
{
	
	/**
	 * Сумма корзины
	 */
	double getTotalPrice() => return lib::sum(
		this.map( double (Product item) => item.getPrice() )
	);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions