Is it possible to export a selector from a library that uses NGXS? - ngxs

I have a library that has a store for my grid data. That library is used within our application. I just tried to use a selector from the library within our application, but its not receiving new data.
So what I want to do is use a selector from my GridState (mistyped it GridStore in my image) from a component in my appication.
Is this something that is possible? I tried using forRoot in the library, but then nothing loads for the libraries components.
Is it possible to otherwise maybe create another shared library with my complete store, so that I can use the selectors from both projects? Is there some kind of best practice/normal way to do this?

Related

Add custom labels using Go-Grpc-Prometheus

we have gRPC service in GoLang. To measure application metrics we would like use existed library https://github.com/grpc-ecosystem/go-grpc-prometheus.
However we need add a custom label to metrics, but it seems that library implementations does not allow it. Can you confirm it, or I'm out, and there is way how to add a custom labels into them? Many thanks.

Include the contents of a file in a Vue template without using a child component

I have a Vue component that contains some template sections that I want to reuse in some new components. These new components share the functionality of the original component via a mixin.
I am aware that one option would be to turn each of the template sections I want to reuse into a component itself. However, if I do this then I'll need to write a heap of new code to handle passing all the variables down and the events back up (there's a lot of them). Really I want it to behave like it is part of the parent component; like a php include().
Is there a straight forward way of doing this with Vue?
I'm using webpack (which came bundled with Laravel and I confess to not knowing an awful lot about) to compile the code, so I wonder if there is some way of doing it with that rather than with Vue itself.

How to render individual sections in Electron desktop-class application?

I started developing a desktop-class application using Electron, and am referring to the starter app as well as the Electron API demo app. This application has a single screen with multiple sections. Interaction within one particular section can cause other section(s) to get updated. These interactions must be in sync with an underlying model [object]; two-way data binding could be helpful here.
What is a recommended way to achieve a multi-section window with each section interacting with one another? Should I compose the layout using DIVs and CSS, or is there a library that I can use effectively with Electron? I was thinking about Handlebars or Jade but I am not sure if I need a template engine, as the entire screen is not rendered and only particular sections will be updated.

How to build a paper-element app with dart?

I want to build a large application in Dart using material design. To accomplish this I included paper_elements into my project. My problem is, that I can't think of a good way to build my multi page application with paper_elements. Usually I create objects which would create their elements inline and add / remove themselves to the dom. The way I understand the paper_element tutorials I found so far this is not possible with them.
Is there a simple way to use paper_elements in dart while having an object based structure? For example I would have my application which loads either a register or login object and displays it in the browser. When logging in it should load a menu object which displays a menu and so on. All page changes should happen without a page reload.
I'm looking forward to all help, examples or links you could provide regarding my problem.
Cheers,
Tim
In Dart you normally build the app as SPA (single page application) without reload.
You can add remove a paper-element like normal DOM elements (div, input, ...) querySelector('#placeholder').append(new Element.tag('paper-input'));
You can also use <template if="{{}}"> or <template repeat="{{}}"> to make Polymer auto-insert these elements when certain conditions are fulfilled or for each value in a collection.
Your question isn't very specific but I guess all you need is already available here on SO as Q/A. Just search for [dart-polymer]. If you don't find anything just ask and we point you in the right direction.
a few that might be relevant
Dart Language: Polymer - Working with views
How to update polymer element bindings after it was removed from DOM and inserted again
How to add attributes to a dynamically created component
how to implement a main function in polymer apps (you don't need a main() when you use a polymer-element that acts as a container for your entire application)
Is imperative Mustache-Binding in Polymer.dart supported?

Using Individual pieces of Backbone Marionette with RequireJS

I am looking to use Backbone Marionette in my application with RequireJS. It looks very promising,especially the Views and Regions. I would like to use them in my application but use some of the existing features already present in my application.
For example,I would like to use my existing Event Aggregator instead of Backbone.Wreqr. Can I do that? Is Backbone.Wreqr hard dependency for Marionette or can Marionette work without it?
Also I would not like to include pieces of Marionette that I do not plan to use in my application, like modules, templateCache, etc.
Is it possible to have a trimmed version of Marionette?
Thanks
Chintan
Currently, Marionette has hard dependencies on multiple libraries. From it's documentation:
Prerequisites
Marionette relies on Underscore, Backbone, jQuery, and various other libraries as its foundation.
JSON2.js
jQuery (v1.7, v1.8, v1.9)
Underscore.js (v1.4.4)
Backbone.js (v1.0.0)
backbone.wreqr.js
backbone.babysitter.js
As far as picking and choosing features, Marionette's code is split up nicely with each main feature in it's own file. You might be able to copy the repo and do one of the following:
AMDify each feature to use with requirejs
Piece together the files/features that you want and amdify the resulting combined file
Rip out the features that you don't want from the generated amdified file.
With any of the routes, be sure to get the dependencies between the features lined up correctly (i.e. Layout depends on ItemView, which depends on View, so you'll need to keep View and ItemView if you intend to use Layout).

Resources