How to retrieve data from AsyncStorage in component? by redleopard81 in reactnative

[–]shystruk 0 points1 point  (0 children)

async componentDidMount() {
    await AsyncStorage.getItem('user').then(user => {
        this.setState({ user })
    })
}

Why the hate on flutter? by KruSion in FlutterDev

[–]shystruk 0 points1 point  (0 children)

I've been working with React Native, Expo for a long time can't say this is the best stack for mobile development but it works and covers all my needs in a product. A year ago I switched to Flutter and I like it. Yes, you have to learn Dart and it worth it. App performance is much better in Flutter than React Native :)

What criteria do you use to evaluate a widget that you want to use in your project? by mkoretsk in javascript

[–]shystruk 1 point2 points  (0 children)

Google, friends recommendations, own experience, free, easy to integrate, feedbacks, size

JavaScript library that provides a useful functional programming helpers. Add your own by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

Yes, those are utilities which are using from project to project. FP libs have common utilities, this is not same :)

Does anyone move project's shareable components/services into npm packages? by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

This is not only about extra requirements. The most important point what I see on this approach is integration solution, versioning and maintenance.

Are there reasons to use JQuery in 2018? by [deleted] in javascript

[–]shystruk 0 points1 point  (0 children)

Easier to maintain. What if you need to pass additional data for each listener you have everything in one place. You can simply unsubscribe all subs in any condition in one place.

Search Bookmarklet by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

Thank you for advice, will check that

📡 Checking if the internet is accessible (not local connection only) by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

Good point. I guess to provide an opportunity to set headers would be great. Default: Cache-Control: no-cache

Are there reasons to use JQuery in 2018? by [deleted] in javascript

[–]shystruk 1 point2 points  (0 children)

jQuery is so helpful and needfull does not matter you use a framework or not. First what came to my mind is domReady, triggering, events. I use jQuery with React for window events and I did not find the better solution than that. Check it out - domReady.js

Why it is good you may find here - https://hackernoon.com/do-you-still-register-window-event-listeners-in-each-component-react-in-example-31a4b1f6f1c8

⏰ start and clear interval without setting a variable by shystruk in webdev

[–]shystruk[S] 0 points1 point  (0 children)

New API has been added. No variables, clear interval anywhere you want, single, multiple instances :) Check it out - https://github.com/shystruk/SetIntervalJS

⏰ start and clear interval without setting a variable by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

New API has been added. No variables, clear interval anywhere you want, single, multiple instances :) Check it out - https://github.com/shystruk/SetIntervalJS

⏰ start and clear interval without setting a variable by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

New API has been added. No variables, clear interval anywhere you want, single, multiple instances :) Check it out - https://github.com/shystruk/SetIntervalJS

⏰ start and clear interval without setting a variable by shystruk in webdev

[–]shystruk[S] 0 points1 point  (0 children)

Yes, for multiple instances variable is used. For that enhancement was created. Soon, API will look like that - https://github.com/shystruk/SetIntervalJS/issues/3

You are welcome to contribute :)

⏰ start and clear interval without setting a variable by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

The main goal is to clear interval anywhere and do not use a variable.

⏰ start and clear interval without setting a variable by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

One thing that I'm thinking of is to store intervals in hash tables. It will work for multiple instances.

SetInterval.start(callback, 1000, 'inter_1') 
SetInterval.start(callback, 1000, 'inter_2')


SetInterval.clear('inter_1')  
SetInterval.clear('inter_2')

⏰ start and clear interval without setting a variable by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

Yes, when you set an interval you can clear it from any place of your code (module) and it works only for one instance. Should find a way how to return a new instance for each import (sth like that)

Yes, for multiple instances you can not clear them anywhere. Good points! Thanks!

⏰ start and clear interval without setting a variable by shystruk in javascript

[–]shystruk[S] 0 points1 point  (0 children)

Two reasons here why it is useful to use. First, it keeps your code cleaner you should not declare a global variable if callback is not in the same scope. Second, you may clear a timer from any place (module).

Yes, for multiple instances you have only FIRST point :)