Shawn Wildermuth

The Blog

My Rants and Raves about technology, programming, everything else...


Creating a Vuex Plugin

VueIf you're building larger scale Vue objects and you're not using Vuex to centralize your state, please stop and go learn Vuex. Really. For those of you still here, sometimes it's helpful to be able to monitor state changes to perform other tasks. For example, to send messages or communicate with servers that aren't about state (e.g. SignalR is a good example). That's where Vuex plugins come in. A Vuex plugin is a simple function that is called once during the setup of a Vuex store. Typically you'd just create the function/arrow function taking an instance of the store:

export default store => {
};

Inside the function, you just want to subscribe to changes to the store as you need. An easy way to think about this is to use subscribe to a mutation:

export default store => {
  store.subscribe((mutation, state) => {
    if (mutation.type === "setError") {
      // Alert someone
      alert("Error occurred!");
    }
  });
};

The mutation that is passed in has a "type" and a "payload". With these properties of the mutation you can determine what to do. For example, the above example just pops up an alert (a really bad thing to do btw) when setError mutation is called. setError is a mutation in a store:

Read...


SignalR Micro Course

SignalR At my training site (Wilder Minds Training), I'm working on a new kind of course for me. I'm calling them Micro-Courses.

The idea behind these new courses is that they are short and teach one very discrete skill. My first one is SignalR!

I will probably be adding more SignalR micro-courses for it's use in different SPA networks fairly soon. If you have a course idea that you would like me to make, feel free to contact me.

Read...


A Vue to a Skill - New Article in Code Magazine

CodeI'm back writing again. I've missed it. You'll see more and more articles in different publications from me in the near future.

The first of these articles is for Code Magazine. It's a quick overview of how Vue works and how you can use it for more than just SPAs. Check it out here:

Let me know what you think!

Read...


Vue.js Talk at Atlanta Vue Meetup

Vue.js I had the opportunity to speak at the Atlanta Vue Meetup recently. This was a great group of people who had mostly had experience with Vue.js.

I'm so used to having to try and convince people to use Vue, that this was a fun talk to get people interested in using it in different ways than they are used to.

As promised, here are the slides and code:

Read...


Vue.js Presentation at the Atlanta .NET Users Group

Atlanta .NET Users Group I had a great time presenting to the Atlanta .NET Users' Group last night. I talked about where I think Vue.js.

I got to espouse my opinion (again) about SPA being large monoliths instead of building 'islands of functionality'. I learned a new achronym too, "Multiple Page Apps" or MPAs for this type of client-side dev.

As promised, I wanted to share the code and the slides:

Read...


Looking Back to 2018 and Forward to 2019

Christmas CardSo it's the new year and I guess I'll join the party with my end of year wrap-up. It's been a big year for me and I'm excited about this next year.

If you've read my blog for a while, you might remember that I did this last year. My goals were a bit hit and miss. Some I did really well, and others I struggled. But I think that's the nature of it all.

This year I turn 50 and I feel old. When I started this job at 16, I didn't think I'd be doing it 34 years later, but here I am. And I'm still loving it. I still code almost every day, and continue to make courses. Here are some categories of my life.

Read...


Should You Be Using the Vue CLI?

Vue.jsThe Vue team has been working hard. Much like Angular, the Vue team has a command-line interface (CLI) to help develop projects with Vue.

If all you're doing is building a SPA, the CLI can really help simplify setting up a project. But is that all you should be doing with Vue?

In my Vue course and talks, I've been advocating that Vue is a good middleground between the philosophies of Angular and vanilla JavaScript. Not every project is a Single Page Application (or multi-page application if you prefer). In this way, I really like how Vue can be scaled up as necessary. In my mind this means that there is a use-case for using Vue without the complexities of a JavaScript build step.

Read...


My ASP.NET Core and Vue.js Workshop in Atlanta

Shawn WildermuthAfter spending most of my time creating online courses, I realized I missed the gratification that I get from face-to-face training. I've decided to do 3-4 workshops a year.

To start this workshop, I'm starting with my home town of Atlanta. On January 16-18th, I'm having a three day workshop to teach how to build a website using ASP.NET Core 2.2 and Vue.js.

The workshop will use the following technologies:

Read...


EntityFrameworkCore Logging in ASP.NET Core

Julie LermanI was reading my newest issue of MSDN Magazine and came across Julie Lerman's great article on how to configure Logging in Entity Framework Core. While this is great information, it only covered logging Entity Framework Core from a non-ASP.NET Core project so I figured I'd explain how to do it in ASP.NET Core.

The biggest thing that is different from the way that Julie shows this is that ASP.NET Core automatically wires up the ASP.NET Core logger to the context when it injects a context into your project. So to see Entity Framework Core logging, you need to enable it your ASP.NET Core logging, not in Entity Framework Core.

First let's talk about how Logging is handled in ASP.NET Core. In your Program.cs file, the WebHost.CreateDefaultBuilder() automatically sets up logging:

Read...


Saudi Arabia User Group Talk

I had the great fortune of doing a remote presentation for a user group in Saudi Arabia. I showed the basics of ASP.NET Core and I loved the questions from the audience.

In general I don't prefer to do remote talks, but with my self-imposed land-locking, I'm available for them for your group if you have a meeting coming up. So as promised, here is the code and slides:

Slides

Read...