@ribajs/core
Advanced tools
Comparing version 0.17.0 to 0.17.1
{ | ||
"name": "@ribajs/core", | ||
"description": "Core module of Riba.js", | ||
"version": "0.17.0", | ||
"version": "0.17.1", | ||
"author": "Pascal Garber <pascal@jumplink.eu>", | ||
@@ -11,3 +11,3 @@ "private": false, | ||
], | ||
"url": "https://github.com/ribajs/riba", | ||
"url": "https://github.com/ribajs/riba/tree/master/packages/core", | ||
"main": "src/index.ts", | ||
@@ -14,0 +14,0 @@ "module": "src/index.ts", |
@@ -62,3 +62,3 @@ import { PRIMITIVE, KEYPATH, parseType } from './parsers'; | ||
*/ | ||
export class Binding implements IBindable { | ||
export class Binding { | ||
@@ -316,3 +316,3 @@ public static FORMATTER_ARGS = /[^\s']+|'([^']|'[^\s])*'|"([^"]|"[^\s])*"/g; | ||
*/ | ||
public publish(forceValue?: any) { | ||
public publish() { | ||
if (this.observer) { | ||
@@ -319,0 +319,0 @@ if (this.formatters === null) { |
@@ -21,6 +21,2 @@ import Debug from 'debug'; | ||
priority?: number; | ||
/** | ||
* If you want to save custom data in your binder logic | ||
*/ | ||
customData?: any; | ||
} | ||
@@ -31,3 +27,3 @@ | ||
*/ | ||
export type Binder<ValueType> = IOneWayBinder<ValueType> | ITwoWayBinder<ValueType> | IBindable; | ||
export type Binder<ValueType> = IOneWayBinder<ValueType> | ITwoWayBinder<ValueType>; | ||
@@ -34,0 +30,0 @@ /** |
@@ -30,5 +30,5 @@ import { IViewOptions, Riba } from './riba'; | ||
public static bindingComparator = (a: IBindable, b: IBindable) => { | ||
const aPriority = a.binder ? ((a.binder as ITwoWayBinder<any>).priority || 0) : 0; | ||
const bPriority = b.binder ? ((b.binder as ITwoWayBinder<any>).priority || 0) : 0; | ||
public static bindingComparator = (a: Binding | ComponentBinding, b: Binding | ComponentBinding) => { | ||
const aPriority = (a as Binding).binder ? (((a as Binding).binder as ITwoWayBinder<any>).priority || 0) : 0; | ||
const bPriority = (b as Binding).binder ? (((b as Binding).binder as ITwoWayBinder<any>).priority || 0) : 0; | ||
return bPriority - aPriority; | ||
@@ -58,3 +58,3 @@ } | ||
public options: IViewOptions; | ||
public bindings: Array<IBindable> = []; | ||
public bindings: Array<Binding | ComponentBinding> = []; | ||
public webComponents: Array<RibaComponentClass> = []; | ||
@@ -290,3 +290,3 @@ // public componentView: View | null = null; | ||
this.bindings.forEach((binding) => { | ||
if (binding.binder && binding.publish && (binding.binder as ITwoWayBinder<any>).publishes) { | ||
if ((binding as Binding).binder && binding.publish && ((binding as Binding).binder as ITwoWayBinder<any>).publishes) { | ||
binding.publish(); | ||
@@ -307,4 +307,4 @@ } | ||
this.bindings.forEach((binding) => { | ||
if (binding.update) { | ||
binding.update(models); | ||
if ((binding as Binding).update) { | ||
(binding as Binding).update(models); | ||
} | ||
@@ -311,0 +311,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2781130
34533