Skip to content

Commit 9f8874a

Browse files
author
Vlad Balin
committed
experimental features
1 parent b4e0d86 commit 9f8874a

File tree

12 files changed

+27
-6
lines changed

12 files changed

+27
-6
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/object-plus/mixins.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export declare function predefine(Constructor: MixableConstructor): void;
2525
export declare function define(ClassOrDefinition: Function): void;
2626
export declare function define(ClassOrDefinition: object): ClassDecorator;
2727
export declare function definitions(rules: MixinMergeRules): ClassDecorator;
28+
export declare function propertyListDecorator(listName: string): PropertyDecorator;
2829
export declare function definitionDecorator(definitionKey: any, value: any): (proto: object, name: string) => void;
2930
export declare class MixinsState {
3031
Class: MixableConstructor;

lib/object-plus/mixins.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/object-plus/mixins.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/transactions.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export declare enum ItemsBehavior {
1111
persistent = 4,
1212
}
1313
export declare abstract class Transactional implements Messenger, IONode, Validatable, Traversable {
14+
static endpoint: IOEndpoint;
1415
static __super__: object;
1516
static mixins: MixinsState;
1617
static define: (definition?: TransactionalDefinition, statics?: object) => typeof Transactional;

lib/transactions.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "type-r",
3-
"version": "2.0.9",
3+
"version": "2.0.10",
44
"description": "Reactive serializable data layer for modern JS applications",
55
"main": "./dist/index.js",
66
"jsnext:main": "./lib/index.js",

src/object-plus/mixins.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ export function definitions( rules : MixinMergeRules ) : ClassDecorator {
131131
}
132132
}
133133

134+
// Create simple property list decorator
135+
export function propertyListDecorator( listName: string ) : PropertyDecorator {
136+
return function propList(proto, name : string) {
137+
const list = proto.hasOwnProperty( listName ) ?
138+
proto[ listName ] : (proto[ listName ] = (proto[ listName ] || []).slice());
139+
140+
list.push(name);
141+
}
142+
}
143+
134144
export function definitionDecorator( definitionKey, value ){
135145
return ( proto : object, name : string ) => {
136146
MixinsState

src/transactions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export enum ItemsBehavior {
3131
export abstract class Transactional implements Messenger, IONode, Validatable, Traversable {
3232
// Mixins are hard in TypeScript. We need to copy type signatures over...
3333
// Here goes 'Mixable' mixin.
34+
static endpoint : IOEndpoint;
3435
static __super__ : object;
3536
static mixins : MixinsState;
3637
static define : ( definition? : TransactionalDefinition, statics? : object ) => typeof Transactional;

0 commit comments

Comments
 (0)