-
Notifications
You must be signed in to change notification settings - Fork 102
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
when i return something in init(), and then i can not call all methods #342
Comments
Thanks for the question! Here is a quote from our docs
Feel free to ask any other questions. 👍 Cheers |
and then, how can i get a stamp when i return an object in init method. |
describe what is my target: i want a new object that has two feature:
|
Hello @lornally Looks like you need to understand the basics of stamps. I'd highly recommend going through this little article: https://medium.com/@koresar/fun-with-stamps-episode-1-stamp-basics-e0627d81efe0 It's very easy to solve your problem. :)
Does that answer? |
actually, i write code like this: const mckpath = stampit()
.init(function init({ start, end, list, ...p }) {
this.start = mpoint(start);
this.end = mpoint(end);
this.train = train({ list });
Object.keys(p).forEach(e => { //here i got all last property, but can we elegant more
this[e] = p[e];
});
}) i use object.key got all property, but can we do it more elegant? |
Thanks for the correction about Instead of the |
thank you very much, and can we do it more elegant than object.assign? |
Yep. Here is my favourite method |
thank you, you are really nice:) i will learn your suggest:) |
Thank you for the kind words mate! Cheers |
i did not certain this is a bug. this is my test code:
The text was updated successfully, but these errors were encountered: