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

feat: implement decode method #3

Merged
merged 4 commits into from
Dec 23, 2019
Merged

Conversation

gorhom
Copy link
Owner

@gorhom gorhom commented Dec 23, 2019

introduce a new method to instantiate a Codable model that extends BaseCodable

usage

class Post extends BaseCodable {
  title!: string;
  isActive?: boolean;
}

Post.CodingProperties = {
  title: types.string,
  isActive: {
    type: types.optional(types.boolean),
    key: 'active',
  },
};

const post = decode(Post, {
  title: "dummy post",
  active: true
});

@gorhom gorhom self-assigned this Dec 23, 2019
@gorhom gorhom merged commit ae60ad4 into master Dec 23, 2019
@gorhom gorhom deleted the feature/implement-decode-method branch December 23, 2019 22:13
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.

1 participant