Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feature/23 serializable actions #55

Merged
merged 6 commits into from Mar 10, 2017

Conversation

mweststrate
Copy link
Member

No description provided.

@mattiamanzati mattiamanzati mentioned this pull request Mar 8, 2017
27 tasks
function deserializeArgument(adm: Node, value: any): any {
if (typeof value === "object") {
const keys = Object.keys(value)
if (keys.length === 1 && keys[0] === "$path")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Use $ref instead or keep as is and change referenceTo return

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -16,7 +16,10 @@ export interface IReferenceDescription {

export function referenceTo<T>(path: string): T;
export function referenceTo<T>(getter: IReferenceGetter<T>, setter?: IReferenceSetter<T>): T;
export function referenceTo<T>(factory: IFactory<any, T>): T;
export function referenceTo(arg1, arg2?) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Maybe export as "reference" to be consistent with other types and more readable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const base = getNode(owner)
const target = getNode(value)
invariant(base.root === target.root, `The value assigned to the reference '${name}' should already be part of the same model tree`)
return getRelativePath(base, target)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Maybe return as {$path: "..."} or {$ref: "..."}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO to code

@coveralls
Copy link

Coverage Status

Coverage increased (+3.2%) to 86.235% when pulling ed146c5 on feature/23-serializable-actions into b95a9dd on master.

@mweststrate mweststrate merged commit 83484d1 into master Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants