This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animateWidth() { | |
Animated.sequence([ | |
Animated.delay(3000), | |
Animated.timing(this.state.width, { | |
toValue: 400, | |
duration: 2000 | |
}) | |
]).start(() => { | |
// Logic whenever an iteration finishes... | |
this.animateWidth() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Animated.loop( | |
Animated.sequence([ | |
Animated.delay(3000), | |
Animated.timing(this.state.width, { | |
toValue: 400, | |
duration: 2000 | |
}) | |
]), | |
{ | |
iterations: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Reflection; | |
using Autofac; | |
using Newtonsoft.Json; | |
using Foo.Configuration; | |
using Module = Autofac.Module; | |
namespace Foo.Modules | |
{ | |
public class ConfigurationModule : Module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Foo.Configuration | |
{ | |
public interface IConfiguration | |
{ | |
string ApiBaseAddress { get; set; } | |
} | |
public class Configuration : IConfiguration | |
{ | |
[JsonConstructor] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ItemGroup> | |
<EmbeddedResource Include="Configuration\config.json" /> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="CopyConfigFiles" AfterTargets="Build"> | |
<Copy SourceFiles="$(MSBuildProjectDirectory)/Configuration-Source/$(Configuration)/config.json" DestinationFolder="$(MSBuildProjectDirectory)/Configuration/" /> | |
</Target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ApiBaseAddress": "https://foo.com/api" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ApiBaseAddress": "https://staging.foo.com/api" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This method gets called by the runtime. Use this method to add services to the container. | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Add framework services. | |
services.AddDataAccessServices(Configuration.GetConnectionString("DefaultConnection")); | |
services.AddMvc(); | |
// Add application services. | |
services.AddTransient<IEmailSender, EmailSender>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Foo.Infrastructure.EntityFramework | |
{ | |
public static class ServiceCollectionExtensions | |
{ | |
public static void AddDataAccessServices(this IServiceCollection services, string connectionString) | |
{ | |
services.AddDbContext<ApplicationDbContext>(options => | |
options.UseSqlServer(connectionString)); | |
} | |
} |