Files
mattermost-mobile/app/utils/mix.ts
Daniel Espino García 980c31f40f Remove watermelondb limitation on updating an already updated model (#7067)
* Remove watermelondb limitation on updating an already updated model

* Add logic to handle different prepare states and improve logging

* fix tests

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2023-02-03 17:11:57 +02:00

18 lines
431 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
class MixinBuilder<T> {
superclass: T;
constructor(superclass: T) {
this.superclass = superclass;
}
with(...mixins: any[]): T {
return mixins.reduce((c, mixin) => mixin(c), this.superclass);
}
}
const mix = <T>(superclass: T) => new MixinBuilder(superclass);
export default mix;