Skip to content

Instantly share code, notes, and snippets.

View Martin-Andersen's full-sized avatar

Martin H. Andersen Martin-Andersen

View GitHub Profile
@joshnuss
joshnuss / httpStore.js
Last active October 11, 2023 11:29
A Svelte store backed by HTTP
import { writable } from 'svelte/store'
// returns a store with HTTP access functions for get, post, patch, delete
// anytime an HTTP request is made, the store is updated and all subscribers are notified.
export default function(initial) {
// create the underlying store
const store = writable(initial)
// define a request function that will do `fetch` and update store when request finishes
store.request = async (method, url, params=null) => {
@EdCharbeneau
EdCharbeneau / RemoteAuthenticatorView.razor
Created June 4, 2020 15:41
All the RemoteAuthenticatorView templates
<RemoteAuthenticatorView Action="@Action">
<LoggingIn>
<span>Logging you in...</span>
</LoggingIn>
<CompletingLoggingIn>
<span>Checking permissions...</span>
</CompletingLoggingIn>
<LogInFailed>
<span>Sorry, your login failed. Please try again or contact support.</span>
</LogInFailed>