Commit 098f75c1 authored by Artem Sakhatskiy's avatar Artem Sakhatskiy
Browse files

readme spellcheck

parent 983572a6
Pipeline #3636619 failed with stages
in 3 minutes and 14 seconds
......@@ -8,21 +8,23 @@ A wrapper over function containing property expression.
`Expression<TType, TResult>` is an interface that extends `Function`. Module `Expression` contains following methods:
```typescript
/*
* Throws errors if given function is not a valid property expression.
*/
validate<TType, TResult>(exp: Expression<TType, TResult>) : void
/*
* Validates given function and applies it to `target`.
*/
apply<TType, TResult>(exp: Expression<TType, TResult>, target: TType) : TResult
module Expression
{
/*
* Throws errors if given function is not a valid property expression.
*/
export const validate<TType, TResult>(exp: Expression<TType, TResult>) : void
/*
* Validates given function and gets property name. Useful for immutable.js.
*/
getProperty<TType, TResult>(exp: Expression<TType, TResult>) : string
/*
* Validates given function and applies it to `target`.
*/
export const apply<TType, TResult>(exp: Expression<TType, TResult>, target: TType) : TResult
/*
* Validates given function and gets property name. Useful for immutable.js.
*/
export const getProperty<TType, TResult>(exp: Expression<TType, TResult>) : string
}
```
Usage
......@@ -50,11 +52,11 @@ const logInfo = <TResult>(exp: Expression<Model, TResult>) =>
logInfo(m => m.value)
// Expression over property: value
// Has a velue "modelThing"
// Has a value "modelThing"
logInfo(m => m.numberValue)
// Expression over property: numberValue
// Has a velue 12351
// Has a value 12351
logInfo(m => {
console.log("This should throw an error");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment