Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
GavinRay97
@GavinRay97
Hmmm
GavinRay97
@GavinRay97
@TehShrike Thanks for taking the time to answer by the way, super appreciate it.
I'd love to make a framework agnostic state-management library using a generic global event bus but I don't know how feasible it is. And even if I sunk the time and effort into it, there are bindings for most state-management libraries available already written for use.
Would seem like most people would probably want to use something that already exists and import extra packages for binding/reactivity than use an agnostic state management and event bus system.
Would you mind if I asked your opinion on something? @TehShrike
Josh Duff
@TehShrike
fire away :-)
GavinRay97
@GavinRay97
I just had a three hour long discussion with a really knowledgeable dev friend of mine on Discord, he's friends with one of the core Redux team and talk with him on Discord often.
Basically we discussed what we thought the idea of optimum state-management system and implementation would look like.
If you're into it at all, I'm really curious to hear your take.
Josh Duff
@TehShrike
Sure thing
GavinRay97
@GavinRay97

I personally think that barebones stores, with util functions and watched/computed properties with an observer/observable pattern to eliminate the need for component state, while also providing the flexibility to do things like declare classes/models with optional and required proptypes and possibly methods in-model is an ideal solution.

Something along the lines of a stripped-down MobX with optional and flexible structure implementation based on app scale/needs.

State management and design patterns around their use are super interesting to me and I love getting wiser folk's views.
Josh Duff
@TehShrike
Another thing I've been thinking about - people really like global stores, for some reason. I usually have very little global state, and leave most state isolated by ui state/component
GavinRay97
@GavinRay97
Yeah, it's app dependent for me.
Small app, probably one store called "appState"
Larger app, multiple stores with respective names.
Josh Duff
@TehShrike
For smaller apps, using component state and no global store usually gets the job done for me
GavinRay97
@GavinRay97
Also very true.
Josh Duff
@TehShrike
I usually only introduce global state if, say, the user is building up a single document as they navigate around from screen to screen
GavinRay97
@GavinRay97
I don't tend to write a store for very small apps, I guess by small app I should've clarified "small by enterprise standards" :joy:
We seem to have pretty in-line views then.
What would the ideal system of app state and the way that components handle binding (i.e. having to declare a state and re-render when state vars are changed versus observing variables in a store and intelligently re-rendering if they change) look to you?
Josh Duff
@TehShrike
I'm not sure. I prefer my state somewhat isolated, with any global state only being injected into the more compositiony components, which then compose a bunch of other dumber view components that get state passed directly to them
Andrew Smith
@silentworks
Are objects passed down through the resolve method immutable?
Josh Duff
@TehShrike
No, though each consumer is passed a separate copy, so if you mutate the object it won't screw any other states over.
Josh Duff
@TehShrike
@silentworks how goes the app?
Andrew Smith
@silentworks
@TehShrike I am at the point of giving up
Josh Duff
@TehShrike
@silentworks whyzat? let me help
Dexter
@neoel
@TehShrike I've got some issues with styling the uiview element, chrome has issues i think in combination with flexbox. Do you have any pointers on styling the elemen?
Josh Duff
@TehShrike
I've never actually tried styling the element directly, that seems like it might have some weird cases. What view renderer are you using?
I'd lean towards <MyStylingComponent><ui-view></ui-view></MyStylingComponent> or <div class="my-child"><ui-view></ui-view></div>
I would only ever consider the ui-view element a dumb placeholder for abstract-state-router, I wouldn't attach any semantic or stylistic meaning to it
Dexter
@neoel
Hmm, lemme try that.
I'm styling the element directly now,
Dexter
@neoel
I've got it a bit better now, but on firefox the elements don't flow properly still...
Josh Duff
@TehShrike
have an example? Also, what templating library are you using - Svelte, Ractive?
Dexter
@neoel
Svelte, don't have an example at hand, will create one tonight (if i get to it).
Josh Duff
@TehShrike
Are you wrapping the ui-view element in a styling element?
Dexter
@neoel
I've got a div around it if that's what you mean? I've got global styling styling that div now.
Dexter
@neoel
I think i've got it working now, making the uiview absolute in a flowing element.
Josh Duff
@TehShrike
What styles are you applying?
Is display: flow the main thing?
Yury Zhuravlev
@stalkerg
yep, it's too silent here
Josh Duff
@TehShrike
aye.
Pat Cavit
@tivac
Using svelte, anyone have an example of passing a route param to a component?
Looks like maybe an activate method?
Josh Duff
@TehShrike
I usually do that in the resolve function just so it's there on the first render
The second argument to the resolve function is the route params
Unrelated: there is an even cooler abstract-state-router chat room over on Discord now: https://discord.gg/G8FrErC
Pat Cavit
@tivac
ffffffffffffff