RC time picker in react redux applications - redux

How can I use "rc-time-picker 3.4.0" within the "react-redux" store to store its state? Can anyone give me the list of examples for using RC-time-picker in "react-redux" application?

Related

Add replicationRegions to an imported DynamoDB table via CDK?

I have a dynamodb table that was created via console and I want to enable multi-region support by adding to the list of replicationRegions using CDK.
After importing the original table using:
const table = Table.fromTableArn(this, "ImportedTable", "arn:aws:dynamodb...");
I realized I did not have access to the tables replicationRegions field as I would when creating new one.
Is there a way add to the list of replicationRegions on an imported dynamodb table using CDK?
Yes, but use cdk import instead of Table.fromTableArn.
The fromSomethingArn-type methods create *read-only* references to an external resource.* You can't use these to modify a resource. The ISomething interface constructs these methods return are useful for things like creating new permissions and targets.
The cdk import command is preview functionality to properly import existing resources into a CDK stack. A DynamoDB Table is a resource type that supports import operations. Once this one-time import completes, the "adopting" CDK stack can modify the "imported" table like any other, say, by adding replication regions.
In other words, The CDK can only modify resources it owns. To make ad-hoc modifications to an existing resource without permanently "adopting" it, use the SDKs instead.
* Earlier versions of the CDK docs did call these from... methods "importing" operations, but have been updated to use the less ambiguous term "referencing".

What's the reason of using useStore in vuex4

Hey would like to know the reason :)
Why import the useStore function instead of importing directly the /store/index.js file
https://next.vuex.vuejs.org/guide/composition-api.html
Seems like it does the same
useStore uses inject (provide/inject api) to access the store. This means that passing the store from another file/dependency is not needed. It is preferred only because it is consistent thematically with the composition API (hooks).

Ionic Firebase app using AngularFire2

How can I convert asynchronous mode to synchronous? Just by Subscribing? I am getting data from Firebase using Firebase API's and displaying them in my app but due to asynchronous mode, the display event occurs before the data is retrieved. I am shifting to using AngularFire but not sure if AngularFire by default uses asynchronous. I want to wait for the data before my program moves to executing next steps. I am using Ionic2, have a provider which connects to Firebase, fetches data, stores in a local array in the provider with the ".then" method. The display page injects the provider and stores Firebase array data locally again in the display page, And then use the local variable in the html (ion-item) to display it. Basically, I want the data to be refreshed with any changes to Firebase data by any user.
Make use of 'async' pipe to display data from any observables in angular template. It populates the view whenever data is ready.
Below reference should help you to have an understanding of handling obervables using angularfire2. cheers :)
https://github.com/angular/angularfire2/blob/master/docs/2-retrieving-data-as-objects.md#retrieve-data
The only way to do this, is to use the 'async' in your template like below.
<ion-list>
<button ion-item class="center" *ngFor="let user of users | async" (click)="showOptions(user.$key, user.Name)">
{{user.title}}
</button>
</ion-list>
Above, there is a list of users type: 'FirebaseListObservable' which is included from the 'angularfire2/database' like below:
import { FirebaseListObservable } from 'angularfire2/database';
You can check this tutorial, which does exactly what you want and there is a live example on the description.
I suggest you to migrate to Ionic 3, it is much easier to use with firebase.

Angular 2 share/change data got from HTTP service between components

I have to develop an Angular 2 application in which I have an HTTP service whose response is a JSON object like that:
plan = {ID: 'planID', installmentsNumber: 10, rate: 5}
I need these data to be shared between more components and every update to be caught by every component.
Which is the best way?
UPDATE (Nov 23, 2016)
I developed my app using Observable, like you can see in the plunk below:
https://plnkr.co/edit/0k0jr8KrJfFKeNkIV6So?p=info
Solved. Thanks to all.
You should use RxJs Observable library for that matter.
As your questions is broad and you haven't shared a working example I propose to you to read the following blog articles:
How to build Angular 2 apps using Observable Data Services
http://blog.angular-university.io/how-to-build-angular2-apps-using-rxjs-observable-data-services-pitfalls-to-avoid/
Angular 2 HTTP Requests with Observables
https://scotch.io/tutorials/angular-2-http-requests-with-observables
I prefer BehaviourSubject because you can initialise it easily and set a default state.

Passing value between two components in angular2-meteor project

I am using angular2-meteor.
When I try to pass a value between two components (when the value change in the first component, create an event in second component and use this new value), I have two ways right now:
One way is meteor way: using this.autorun and Session.get.
Another way is angular2 way: using Injectable service with EventEmitter.
Which way should be prior? Or is there any other better way? Thanks
Now I used angular2-meteor a while.
Although the angular2-meteor tutorial has no example so far about using or choosing Angular 2 service or Meteor Session.
But I feel angular 2 takes the lead in the front end, while meteor makes reactivity easier and also handle all back end things.
So I went with angular2 way using service to share between components. And service is very powerful like #todd-w-crone said.
If anyone has better answer, I will switch to accept that one.
I find it practical to create a new service called App.states.ts which is accessed globally and mimics Session (get / set).
I commonly import this service to all necessary components to get or set new value such as User.status, company.profile, lastProduct, etc.
Since this service is #injectable it can also make use of other services, in case a value hasn't been set already.
This allows me to ask for a variable in a component appState.getLastModifiedItem(), then in app.states.ts I'll write this function to pass this.modifiedItem or either:
Request another service item.service.ts to fetch data
Call another function with itemCollection.findOne({...}) and return such value.
You can configure Mongo queries as you want and either store static data in appState or keep subscription items in appState.
Do take into consideration that all subscriptions handled by an #injectable within a component are imported by such component. Be wary of conflicting subscriptions between components/services.

Resources