Presuming _mixin_ functionality remains as we know it today.. what are they most useful for? Can we think of any low level implementations like the Logger that would be useful in many projects?
Some inspiration:
InternalLinker - handles the routing of internal viewsMouseTrap - maps mouse events to the app stateWindowScroller - maps window scroll position to the stateMediaPlayer - wraps native audio/video element state and actionsFirebaseStore - connects to realtime db and emits stream eventsThere are no _wrong_ answers here! Any responses that get many positive reactions will get added to the inspiration list above for others to make note.
馃摝 Bonus points for extra creative naming
@lukejacksonn Good question! Let's see what kind of response do you get.
By the way, mixins (formerly known as plugins) were introduced when we decided to decouple the previously built-in router from app.js into its own file.
Here a starter for hyperapp package shameless based on the @hyperapp/router : Swizz/hyperapp-package
I dont know the @jbucaran thoughts about it, but I think I will personally use this to quick start hyperapp package with ease :tada:
(Ill be glad to gift it to the org)
@Swizz That is cool, but please notice @lukejacksonn is trying to collect ideas for mixins.
Ideas for useful mixins
:)
Ow sorry, I thinked he was asking for Mixins (and alike) creation. I can remove my comment as you wish.
Inspired by the firebase-store-idea: something that lets you control and react to PouchDB replication
PouchDBInterface maybe? (I know, I'm not getting bonus points for that one)
@Swizz No need to do that. 馃槃
Another example are mixins that wrap views to provide something similar to what we were trying to achieve with components.
Here is a simple one:
const Component = mixin => (props, children) =>
"view" in props ? mixin : mixin.view(props.state, props.actions, children)
@lukejacksonn Isn't MediaPlayer more like a component (prev. known as custom tags)?
@jbucaran: but if you want to keep the player controls in sync with the app (perhaps to implement a custom player-controls-bar) you'll need more than just the vtree. Youll need the state, events, and actions too. Seems like the perfect candidate for a mixin to me
@zaceno I see what you mean. 馃憤
What @zaceno said! This would work especially well with https://github.com/MatejMazur/hyperapp-mixin
I'm basically using mixins for these things:
postMessage)To reduce "spam" in my email inbox I unsubscribe from most threads. @mention me if you want to respond.
Thanks for the feedback y'all.. closing this for now!
Most helpful comment
I'm basically using mixins for these things:
postMessage)To reduce "spam" in my email inbox I unsubscribe from most threads.
@mentionme if you want to respond.