-
Notifications
You must be signed in to change notification settings - Fork 7
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
ReactiveState: add namespaces #5
Comments
Interesting. We can add it to the initialisation options: AppState = new MeteorFlux.AppState({ prefix: 'state' }); Would that be ok? |
That looks great. |
Global helpers make sense in the case of a singleton object. So, to me, global helpers should be part of AppState, not ReactiveState. |
Totally true, they should be in a different package |
Just spent 1 hour because of this. Suppose you use <template name=myTemplate1>
{{>myTemplate2 doc=whatever}}
</template>
<!-- Args: doc -->
<template name=myTemplate2>
<div>doc.name</div> <!-- Here doc is not the template parameter! -->
</template> |
That's not because of AppState, but because of how Meteor global Template helpers work. If you do: Template.registerHelper('dod', function() {
return object;
}); it will happen the same. If you make a PR with a namespace option for ReactiveState I will accept it. For example: AppState = new ReactiveState({
namespace: 'state'
}); <template name=myTemplate2>
<div>doc.name</div> <!-- Here doc is the template parameter -->
<div>state.doc</div> <!-- Here doc is the AppState parameter -->
</template> |
I would prefer to use global helpers like this:
Otherwise I need to prefix my root path in order to avoid mix up with template helpers...
The text was updated successfully, but these errors were encountered: