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

Thanks for the inspiration! #22

Open
Download opened this issue Apr 10, 2017 · 0 comments
Open

Thanks for the inspiration! #22

Download opened this issue Apr 10, 2017 · 0 comments

Comments

@Download
Copy link

I read your blog post and browsed this repo and it is amazing stuff you have here!
I got really inspired by your work so I ran with it and created this library, loosely based on mixwith:

mics

It looks a lot like yours with some (big) differences:

  • I merged mix and mixin into one
  • with is optional syntax sugar
  • mix can return a mixin instead of a class
  • mixins can be used to instantiate an object directly
  • mix can combine multiple mixins into a new one

I found that creating an actual class is often not desirable because it limits the potential uses for the code. Instead, mics promotes the use of mixins everywhere:

import { mix, is } from 'mics'

var Looker = mix(superclass => class Looker extends superclass {
  look() {
    console.info('Looking good!')
  }
})

// directly instantiate a looker:
var looker = new Looker()
looker.look()

Thanks again for inspiring me and I'd love to get some feedback from the master!

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

No branches or pull requests

1 participant