If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
answer
| const DDATA_API_KEY = 'YOUR_API_KEY'; | |
| const ddataAPI = body => { | |
| return new Promise((response, reject) => { | |
| let xhr = new XMLHttpRequest(); | |
| xhr.open("POST", "https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address?5"); | |
| xhr.setRequestHeader("Accept", "application/json"); | |
| xhr.setRequestHeader("Authorization", `Token ${DDATA_API_KEY}`); | |
| xhr.setRequestHeader("Content-Type", "application/json"); | |
| xhr.onreadystatechange = () => { |
| import fetch from 'node-fetch'; | |
| import jsonfile from 'jsonfile'; | |
| const GQL = (query, variables) => ({query, variables}) | |
| const request = (...args) => { | |
| try { | |
| return fetch(...args) | |
| } catch (e) { | |
| return Promise.reject({errors:[e]}); |
Tools:
| /** | |
| * @flow | |
| */ | |
| import React from 'react'; | |
| import { | |
| Image, | |
| View, | |
| } from 'react-native'; |
| /** | |
| * Autocomplete Input for Google Places API | |
| * @flow | |
| */ | |
| import React, {Component} from 'react'; | |
| import { Input } from 'native-base'; | |
| import {get} from '../utils/request'; |
| export default styles => Object.keys(styles) | |
| .filter((key) => !/^_/.test(key)) | |
| .reduce((prev, next) => ({...prev, [next]:styles[next]}), {}); |
| package com.app; | |
| import android.content.Intent; | |
| import android.net.Uri; | |
| import android.provider.Settings; | |
| import android.content.pm.PackageManager; | |
| import android.os.Build; | |
| import android.os.Bundle; | |
| import com.facebook.react.ReactActivity; |
All of the state management libraries you mentioned have their unique features and advantages, and the choice of which one to use ultimately depends on the specific needs and requirements of your project. However, here's a brief overview of each library:
MobX: MobX is a simple, lightweight, and easy-to-learn library for managing state in React applications. It has a reactive programming model and provides automatic state updates, which means you don't have to write complex code for updating your app's state. It also has good performance and works well with TypeScript.
React Context: React Context is a built-in feature of React that allows you to share data between components without having to pass props down the component tree. It's a good choice for simple use cases where you need to share state between components without any complex logic.
Redux: Redux is a widely-used library that provides a single source of truth for managing state in large-scale React applications. It has