export const state: State = $state({ user: undefined });
The problem is, this creates global (server-wide) state, when it should be "user-local" global state.
export const state: State = $state({ user: undefined });
The problem is, this creates global (server-wide) state, when it should be "user-local" global state.
One pattern that I love to use in my SvelteKit projects is returning writable stores from the layout’s load function. This makes it possible to fetch data from the server (for example the user object for the logged in user), and then you make this object available as a writable reactive store throughout the whole application. So when the user updates their username or avatar, you do the PUT request to the server and you get the updated user object back from the server as the response, you can simply update the $user writable store value and every place in your app where you show the user object gets updated immediately.
But what if you want to update this user instance? For example on your website you have a form where the user can change their name, username, or avatar. When the form is submitted this gets stored on the server, but the site still shows the old user information, for example it still shows the old avatar of the user in the top menu. The user variable isn’t writable, so how do you overwrite this?
Dass mehr als um die Antarktis erreicht im September seine größte Ausdehnung. Die von Eis bedeckte Fläche dort war nie so gering wie in diesem September. Im Vergleich zu der Periode zwischen 1981 und 2010 ging sie etwa um die Fläche von Alaska zurück. Diese Entwicklung ist auch deshalb beunruhigend, weil sie erst 2016 einsetzte und das antarktische Meereis offenbar insgesamt in einen anderen Zustand geraten ist. https://www.nytimes.com/2023/10/04/climate/antarctic-sea-ice-record-low.html
Millman • •, Jennifer. ‘NY Pre-Christmas COVID Testing Delivers Record Total Just Shy of 50,000 Cases in Single Day’. NBC New York (blog). Accessed 3 January 2022. https://www.nbcnewyork.com/news/coronavirus/ny-pre-christmas-covid-testing-delivers-record-total-just-shy-of-50000-cases-in-single-day/3468284/.
Jeffrey-Wilensky, Jaclyn, and Caroline Lewis. ‘NY Nursing Homes See Overnight Surge In Employee COVID Vaccinations Thanks To State Mandate’. Gothamist, 1 October 2021. https://gothamist.com.
Jonathan Robinson on Twitter. (n.d.). Twitter. Retrieved 6 September 2021, from https://twitter.com/jon_m_rob/status/1431734411335176199
Rafael Irizarry. (2021, August 8). Vaccines work in a gif update: COVID19 cases versus vaccination rates in US states through time. The Delta variant effect can be seen clearly starting in July. States with lower vaccination rates are affected much worse. Https://t.co/e0SQpa8Qg0 [Tweet]. @rafalab. https://twitter.com/rafalab/status/1424440520361787392
Conor Kelly. (2021, July 14). Correlation between vaccination coverage and COVID hospitalizations per million over time, by state https://t.co/g6AMTDXOzb [Tweet]. @CohoKelly. https://twitter.com/CohoKelly/status/1415310919266095113
Calgary, Open. ‘COVID-19 Case Surveillance Public Use Data with Geography | Data | Centers for Disease Control and Prevention’. Accessed 26 March 2021. https://data.cdc.gov/Case-Surveillance/COVID-19-Case-Surveillance-Public-Use-Data-with-Ge/n8mc-b4w4.
Goolsbee, Austan, and Chad Syverson. ‘Fear, Lockdown, and Diversion: Comparing Drivers of Pandemic Economic Decline 2020’. Journal of Public Economics 193 (1 January 2021): 104311. https://doi.org/10.1016/j.jpubeco.2020.104311.
Solid’s State primitive is arguably its most powerful and distinctive one. Through the use of proxies and explicit setters it gives the control of an immutable interface and the performance of a mutable one
Provides state management for tree-like components. Handles building a collection of items from props, item expanded state, and manages multiple selection state.
Holtz, D., Zhao, M., Benzell, S. G., Cao, C. Y., Rahimian, M. A., Yang, J., Allen, J., Collis, A., Moehring, A., Sowrirajan, T., Ghosh, D., Zhang, Y., Dhillon, P. S., Nicolaides, C., Eckles, D., & Aral, S. (2020). Interdependence and the cost of uncoordinated responses to COVID-19. Proceedings of the National Academy of Sciences, 117(33), 19837–19843. https://doi.org/10.1073/pnas.2009522117
Cronin, C. J., & Evans, W. N. (2020). Private Precaution and Public Restrictions: What Drives Social Distancing and Industry Foot Traffic in the COVID-19 Era? (Working Paper No. 27531; Working Paper Series). National Bureau of Economic Research. https://doi.org/10.3386/w27531
Friedson, A. I., McNichols, D., Sabia, J. J., & Dave, D. (2020). Did California’s Shelter-in-Place Order Work? Early Coronavirus-Related Public Health Effects (Working Paper No. 26992; Working Paper Series). National Bureau of Economic Research. https://doi.org/10.3386/w26992
Cotti, C. D., Engelhardt, B., Foster, J., Nesson, E. T., & Niekamp, P. S. (2020). The Relationship between In-Person Voting and COVID-19: Evidence from the Wisconsin Primary (Working Paper No. 27187; Working Paper Series). National Bureau of Economic Research. https://doi.org/10.3386/w27187
Dave, D. M., Friedson, A. I., Matsuzawa, K., & Sabia, J. J. (2020). When Do Shelter-in-Place Orders Fight COVID-19 Best? Policy Heterogeneity Across States and Adoption Time (Working Paper No. 27091; Working Paper Series). National Bureau of Economic Research. https://doi.org/10.3386/w27091
Goldman, D. S. (2020). Initial Observations of Psychological and Behavioral Effects of COVID-19 in the United States, Using Google Trends Data. https://doi.org/10.31235/osf.io/jecqp
Haman, M. (2020). The use of Twitter by state leaders and its impact on the public during the COVID-19 pandemic. https://doi.org/10.31235/osf.io/u4maf
The COVID Tracking Project - Twitter
What U.S. States Are Ready To Test & Trace? (n.d.). #TestAndTrace: The Best Contact Tracing Resource. Retrieved May 12, 2020, from https://testandtrace.com/state-data/
Apr 21, P., & 2020. (2020, April 21). State Data and Policy Actions to Address Coronavirus. The Henry J. Kaiser Family Foundation. https://www.kff.org/health-costs/issue-brief/state-data-and-policy-actions-to-address-coronavirus/